From 1465a190e6e04dc59ff9ce1356158b67cdd2d536 Mon Sep 17 00:00:00 2001 From: Steve Dignam Date: Fri, 2 Dec 2016 23:34:02 -0500 Subject: [PATCH] Fixed error produced with modified off Before, when pressing 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. --- autoload/repeat.vim | 3 +++ 1 file changed, 3 insertions(+) diff --git a/autoload/repeat.vim b/autoload/repeat.vim index f2caeb4..3ec9b53 100644 --- a/autoload/repeat.vim +++ b/autoload/repeat.vim @@ -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