Closed scresto09 closed 4 months ago
Seems to make sense, just curious when the problem exactly happens - could you give an example when the output of the plugin differs from vim?
Sure, here's an example:
Open a 5 line file Move the cursor to line 2 press "2dd" to delete 2 lines press "u" to cancel
With a real VIM, the cursor stays on line 2 With Geany Vimode not patched, the cursor goes to the last line
But this isn't really what vim does, is it? Try the following with this patch:
u
The undo happens but your cursor is still on the first line instead of being at the position of the change which is very confusing. I think what you want instead is to get the information where the undo happened and move the cursor to the first line of the diff. Maybe you could achieve this using SC_PERFORMED_UNDO
(not sure, I haven't studied how exactly this works and if it provides enough information).
You're right, my previous correction was not correct.
327cdde is a new fix using the SC_MOD_BEFOREINSERT and SC_PERFORMED_UNDO events to save the cursor position.
Looks good, thanks!
One last request - would you squash all the commits into one? I'll merge it afterwards.
Also prefix the commit message with vimode:
so it's clear what plugin the commit modifies.
OK, I did it, is it okay? Thanks
Looks great, thanks!
Trying to get more Vim-like behavior for cursor position after using undo (U key)