rickhowe / diffchar.vim

Highlight the exact differences, based on characters and words
http://www.vim.org/scripts/script.php?script_id=4932
MIT License
217 stars 10 forks source link

[Regression] Visual mode broken #5

Closed protist closed 7 years ago

protist commented 8 years ago

I just upgraded to diffchar 6.3, and visual mode no longer works. I press v or V, then attempt to move with hjkl. Vim immediately puts me back in normal mode.

I tried reverting to diffchar 6.2, and visual mode works perfectly. Visual mode is obviously important for :diffget, etc.

rickhowe commented 8 years ago

Thanks for using and asking. I found my error. Please try to add one line in autoload/diffchar.vim as a workaround. I will check any other regression in visual mode.

--- diffchar.vim    2016-10-12 13:56:06.353957400 +0900
+++ diffchar2.vim   2016-10-13 19:35:23.315363200 +0900
@@ -993,6 +993,8 @@
 endfunction

 function! s:ShowDiffCharPair(key)
+   if mode() != 'n' | return | endif
+
    call s:RefreshDiffCharWID()

    let bkey = (a:key == 1) ? 2 : 1
protist commented 8 years ago

Thank you. That works perfectly! (Also I do very much like the improvements to 6.3. The dynamic highlighting of the other pane is very cool!)

Coacher commented 8 years ago

I also experience this problem. I can provide any extra info if needed.

protist commented 7 years ago

Fixed in release.