tpope / vim-repeat

repeat.vim: enable repeating supported plugin maps with "."
http://www.vim.org/scripts/script.php?script_id=2136
2.59k stars 81 forks source link

repeat#wrap hides undo/redo messages #27

Closed wilywampa closed 6 years ago

wilywampa commented 9 years ago

With regular u/<C-r> Vim echoes some information about the undo state, e.g. 1 change; before #11 12:30:44. That message isn't displayed if the undo comes from the normal command, e.g. exe 'norm! u'. feedkeys('u', 'n') does display the message, so this is my proposed fix:

diff --git a/autoload/repeat.vim b/autoload/repeat.vim
index 18b1280..c69a63f 100644
--- a/autoload/repeat.vim
+++ b/autoload/repeat.vim
@@ -97,7 +97,8 @@ endfunction

 function! repeat#wrap(command,count)
     let preserve = (g:repeat_tick == b:changedtick)
-    exe 'norm! '.(a:count ? a:count : '').a:command . (&foldopen =~# 'undo' ? 'zv' : '')
+    call feedkeys((a:count ? a:count : '').a:command, 'n')
+    exe (&foldopen =~# 'undo' ? 'norm! zv' : '')
     if preserve
         let g:repeat_tick = b:changedtick
     endif
blueyed commented 9 years ago

:+1: Came here to report the issue and this patch works. Thanks!

I've created a PR with it: #29.

justinmk commented 6 years ago

Addressed by https://github.com/tpope/vim-repeat/pull/33.