-
Notifications
You must be signed in to change notification settings - Fork 12
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
Backspacing across lines leaves first character on line showing #7
Comments
Hello Chris, thank you for the report. |
Thanks for the quick response. I tried it and the character gets deleted now, but the cursor still jumps to the previous line rather than going to the first column. Regarding the other point you made, why is that the intended behavior? It seems inconsistent and it's easy to backspace over the last character using |
Hm, I am not sure. Maybe has to do something with the way X key works in normal mode. There was good reason why I implemented it this way. Perhaps now with the current way the source code is laid out there must be a cleaner way to implement this feature without such behaviors. I shall have a look. |
Ok, i've pushed a fix for the a command, and also added s command because it seems to work fine with that for the most part. The problem is that we are reusing the X and x keybind functionality to achieve this feature and it's not enough to accomodate for all the cases of cursor being at the end of the line or at the beginning, but in my opinion it's actually small price to pay since it works fine in most general use cases now. (I tend to (re)force push last few commits if I make a mistake, so make sure to reset last few commits before pull if |
Looks like it's still jumping from column 2 to the previous line rather than backspacing to column 1. For the second issue, I'm seeing strange behavior. If I type from insert mode: 'a', 'b', 'c', escape, 'a', backspace, it shows "ac" rather than "ab" and the cursor jumps two columns on the backspace. And when using 'i' to enter insert mode backspace doesn't move the cursor the first time. |
Yeah that's the issue I was talking about. It would do that on line endings. It is what it is :( |
It basically does the same thing a command $X would do or $x. We don't have any means of aserting those cases since command a moves forward to a '\n' character. Builing a specialized solution to solve those edge cases may be too much trouble adding lots of new lines of code which a project like this tries to avoid. |
I'll see maybe I add if statement just for those, since when we at the end xoff is bigger than k-1 and we can catch that by reversing the condition for next instruction. Try the last commit, let me know if this helps. |
Cool, append-backspace works perfectly now. Remaining issues:
|
Actually append backspace still have an edge case, try doing: inset mode: 'a' 'b' 'c' escape, h (to move left), a (enters insert), backspace this will delete 'c' instead of 'b'
You see the problem may also be that you fix 1 thing but break other keybind. That code has to handle lots of |
Hello Chris, I think commit 87ef32f fixes some of the edge cases including 1. I tested it somewhat, please report if you find anything else odd. |
hm. it only fixes the problem if there is space on line above, which would delete wrong character after join. to fix 1. I still have to see what gives. |
Ok I don't know, there may still be some edge cases but at least for now none too bad that I see right now. This thing is a pain in the ass to debug but at least with the last few patches I was able to get rid of a lot of lines of code from that implementation. Seems like the join point does not work correctly with c command in some cases (but its not like it ever worked correctly to begin with) |
Nice, looks like the backspacing across lines issue is fixed. |
In insert mode, when I type:
'x', enter, 'x', enter, backspace, backspace, backspace
, the second x remains until escape is pressed.The text was updated successfully, but these errors were encountered: