Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix invalid cursor states and visual selection issues #168

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mheister
Copy link

I found that pressing dd on the last line twice would make the program crash and made changes to prevent the cursor staying in invalid positions after dd and deletion of a visual selection.
As I found it hard to test these things separately, this also changes the behavior of visual selections such that selections with starting line below end line can be yanked/deleted and prevents the internal end position of the selection to go negative.

After deleting lines, the cursor is moved to a valid position consistent with the hjkl
movement limits. E.g., after deleting the last line with dd, it moves up one line. This
furthermore prevents the internal start index of the visual selection to be decreased past
zero and makes delete and yank of the visual selection work when the selection is expanded
from the bottom, i.e., the start is below the end.
@spytheman
Copy link
Member

@medvednikov what do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants