From ad5a8e06cd716b59de72ccbcdb12da9f9fa06fe9 Mon Sep 17 00:00:00 2001 From: Ace Date: Thu, 13 Apr 2017 01:30:42 +0800 Subject: [PATCH] Update README.md due to bug fix. Refine a comment. --- README.md | 5 ----- autoload/AutoCenter.vim | 5 +++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index d88a171..d0c884e 100644 --- a/README.md +++ b/README.md @@ -19,8 +19,3 @@ When enabled, operation, so it doesn't affect them. - `=` key acts like its default behavior except that it centers lines instead of indenting them. - -## Known bugs - -A redo reaching the latest change is taken as a new change, causing the autocmd -centering current line. diff --git a/autoload/AutoCenter.vim b/autoload/AutoCenter.vim index dd58ed0..35970ba 100644 --- a/autoload/AutoCenter.vim +++ b/autoload/AutoCenter.vim @@ -54,8 +54,9 @@ function! s:center() "{{{ center " Put cursor back on the same char it is on before centering. call cursor('.', l:curpos + indent('.')) - " A change in Insert mode or Replace mode is in progress. - " Only update the max change number when a change is done. + " An ongoing change in Insert mode or Replace mode is not taken as a new + " change if updating the 'b:AutoCenter_MaxChangeNr' during this time. To avoid + " this, wait until it is done. if mode() !~ '^[iR]' call s:upMaxChangeNr() endif