mirror of
https://github.com/tpope/vim-repeat.git
synced 2026-09-10 07:16:26 -04:00
Fixed error produced with modified off
Before, when pressing <C-r> in a buffer that has &modified set to 0,
repeat would produce an error:
Error detected while processing function repeat#wrap:
line 2:
E21: Cannot make changes, 'modifiable' is off
Press ENTER or type command to continue
Now, repeat checks if the buffer is modifiable before executing.
This commit is contained in:
parent
7a6675f092
commit
1465a190e6
|
|
@ -110,6 +110,9 @@ function! repeat#run(count)
|
|||
endfunction
|
||||
|
||||
function! repeat#wrap(command,count)
|
||||
if !&modifiable
|
||||
return
|
||||
endif
|
||||
let preserve = (g:repeat_tick == b:changedtick)
|
||||
exe 'norm! '.(a:count ? a:count : '').a:command . (&foldopen =~# 'undo\|all' ? 'zv' : '')
|
||||
if preserve
|
||||
|
|
|
|||
Loading…
Reference in a new issue