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

Fixes the end of line bindings in vi-mode. #3006

Closed
wants to merge 2 commits into from

Conversation

andgra2
Copy link

@andgra2 andgra2 commented May 7, 2016

Solves issue #3005

@andgra2
Copy link
Author

andgra2 commented May 7, 2016

I did a quick fix similar to the way the w binding was fixed earlier, but ideally end-of-line should be fixed. Some other bindings depends on its current behaviour. For example A, but that could be handled.

Similarly forward-wordcould be fixed, so that we don't need the forward-char correction in the w binding. However this is another thing.

Similarly other things could be fixed in a better way.

@krader1961
Copy link
Contributor

I"m not convinced this is the correct fix. The end-of-line function is doing the right thing in as much as the line contains a trailing space. The problem is that pressing [esc] to switch to normal/command mode doesn't remove the trailing space after moving the cursor to the last typed character. Whether that should be done in the cancel command or the \e binding is TBD.

@andgra2
Copy link
Author

andgra2 commented May 8, 2016

@krader1961: I agree and I think it should be done in the cancel command because there is the root cause of the problem.

Solving it the way you suggested also fixes forward-char so that it in normal mode can't move the cursor past the last character that we have typed in.

I revered my earlier quick fix and i'll try to solve it in this better way instead.

@andgra2
Copy link
Author

andgra2 commented May 8, 2016

@krader1961: Maybe an even better solution would be to not add that extra space in the first place, and instead just have an extra position (with no character in it) after the last character while in insert mode, but not have that extra position while in other modes. Having a space there seems like an ugly hack.

I think this is how it works in vim, there is an extra position after the last character and at that position there is no character, it's not part of the text.

@krader1961 krader1961 closed this May 8, 2016
@elliott-beach
Copy link
Contributor

elliott-beach commented Aug 28, 2017

@krader1961 Implementing a buffer ending with character with a position with no character does sound correct, but it would also be difficult to implement, especially for someone like, for example, me. Would you be opposed to a PR that modified the behavior of the cancel commmand?

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants