thaerkh / vim-workspace

📑 Automated Vim session management with file auto-save and persistent undo history
Apache License 2.0
466 stars 30 forks source link

The cursor moves on 3 symbols right #9

Closed backdround closed 5 years ago

backdround commented 7 years ago

Whenever, i do some action, cursor moves on 3 symbols right. There is if autosave is enabled. neovim/arch

uipoet commented 7 years ago

I experienced the same issue and resolved it by specifically disabling the trimming of whitespace on autosave: let g:workspace_autosave_untrailspaces = 0

freder commented 7 years ago

same problem here.

I noticed it happens, when I'm editing .js files, but not when I'm editing .vim files. – hope that helps.

snkshukla commented 6 years ago

For me, earlier cursor was moving 1 char right, now 2 chars right, is there a fix without disabling whitespace trimming? For me it only happens in .go files.

heratech commented 6 years ago

I think I am getting this issue or a linked issue using Ultisnip. When I have workspace enabled (plugin loaded) the ultisnip goes into the wrong position (2 or 3 spaces to the right of where it should)..

maiconviking commented 6 years ago

@uipoet Your solution solved the issue for me. Thank you.

wayneforrest commented 6 years ago

@uipoet Your solution works for me too.

dustypaws commented 5 years ago

@uipoet Thanks for saving my bacon, mate! :smile:

thaerkh commented 5 years ago

I wasn't able to replicate the issue until today - it looks like this happens in some file types (not all) when wrap is enabled by default, on lines that are wrapping (edit: at least that's my first observation, seeing this now in lines with tabs in them), and is likely due to the virtcol native method (getting different cursor numbers from what they're supposed to be), which might be a bug in Vim itself. I'll see to resolve the issue within the plugin.

thaerkh commented 5 years ago

This should be resolved now with https://github.com/thaerkh/vim-workspace/commit/892a00d199443f09c0a1b93a35c8f9cd1093bb33 (col was a more accurate call for this purpose as it was exact byte position)