easymotion / vim-easymotion

Vim motions on speed!
http://www.vim.org/scripts/script.php?script_id=3526
7.5k stars 362 forks source link

Easymotion introduces "Modified" status to undo history. #339

Closed dimhatz closed 7 years ago

dimhatz commented 7 years ago

Opening as new issue, since cannot reopen the original here: https://github.com/easymotion/vim-easymotion/issues/290

GVim on Windows 10, both 64bit. Precompiled version from https://tuxproject.de/projects/vim/

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled Jun 22 2017 20:05:01)
MS-Windows 64-bit GUI version with OLE support
Included patches: 1-655
Compiled by hp@HP-PC
Huge version with GUI. 

Also tested 64-bit version v8.0.0698 from https://github.com/vim/vim-win32-installer/releases. Bug still occurs. Haven't tested other platforms.

Here is how to reproduce: Install the plugin and put this in _vimrc:

set nocompatible               " Be iMproved
set laststatus=2    " Always show status bar
map <Leader> <Plug>(easymotion-prefix)

Now open any file that has some text in it :e ~/_vimrc Press <Leader>j to highlight the beginning of each line. Press <Esc> to cancel the motion (or any key to perform motion - does not matter) Press u to undo.

Expected behavior: nothing happens to the buffer, since we did not change any text.

Actual behavior: u shows the buffer in a changed state (as if some change was performed). The statusline on the bottom shows [+] as if there was a modification to the buffer. This causes confusion when using undo, I'm not sure if it also corrupts the undo history.

P.S. using the original prefix mapping <Leader><Leader> still causes the bug to appear.

ghost commented 7 years ago

I think that the modified [+] is part of the plugin functionality. I can reproduce, but it doesn't repeat after that. Undo only jumps to the previous position.

Any scenario besides this, I can't reproduce (open a file that has some text, without any undo persistence, and don't change any text, because if you do, you can't reproduce it anymore [and it doesn't mess with the undo history]).

haya14busa commented 7 years ago

fixed. thank you for the report. Can you confirm it?

dimhatz commented 7 years ago

Fix confirmed. Thank you very much!