Skip to content

Conversation

sakurawald
Copy link
Contributor

In vim, the jump-back and jump-next will recenter jump target line if the line is not inside the window before jump.

@sakurawald
Copy link
Contributor Author

The code is formatted by the default formatter provided by lem.
I didn't know why the identation is different from the original file. It's annoy, each time i have to reset the identation differs.

@sakurawald
Copy link
Contributor Author

sakurawald commented Dec 9, 2024

Sorry, i didn't notice that 1 line code is deleted accidently. Now the CI tests will pass.

@sakurawald
Copy link
Contributor Author

I remove the target-point binding in let form, and document the return value of (jump-back) and (jump-next).
It looks clearer.

@sakurawald sakurawald changed the title feature: recenter line if jump target point is not inside window. (vi-mode) [DRAFT] feature: recenter line if jump target point is not inside window. (vi-mode) Dec 10, 2024
@sakurawald
Copy link
Contributor Author

sakurawald commented Dec 10, 2024

I make this pr a draft, and considering make it a feature in lem.

A new line positioning strategy to re-position where the line should the cursor in after jumping the point. Or to say, a function line-view-position-function to be called after we move-point to a new point.

The strategy can be: none, recenter-current-line-if-new-point-is-not-inside-original-window-view, scroll-line-to-top-of-window, scroll-line-to-bottom-of-window.

We can introduce a new special variable named line-positioning-strategy and making it integrate with the move-point function.

Copy link
Contributor

This pull request has been inactive for {days} days. If there is no activity within the next 7 days, it will be automatically closed. Please comment or push new commits to keep it open.

@github-actions github-actions bot added the stale label Aug 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant