From 5ca576b2fe01d3d178218f229bc325333f16f248 Mon Sep 17 00:00:00 2001 From: TIAN Yuanhao Date: Wed, 10 Sep 2025 15:09:57 +0800 Subject: [PATCH] Change `mapcheck` to `maparg` The difference with maparg() is that mapcheck() finds a mapping that matches with {name}, while maparg() only finds a mapping for {name} exactly. Signed-off-by: TIAN Yuanhao --- plugin/better-whitespace.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugin/better-whitespace.vim b/plugin/better-whitespace.vim index 402a360..79e7025 100644 --- a/plugin/better-whitespace.vim +++ b/plugin/better-whitespace.vim @@ -461,13 +461,13 @@ command! -range=% PrevTrailingWhitespace call GotoTrailingWhitespace(1,
  • '.g:better_whitespace_operator.' :StripWhitespace' endif " Ensure we only map if no identical, user-defined mapping already exists - if (empty(mapcheck(g:better_whitespace_operator, 'n'))) + if (empty(maparg(g:better_whitespace_operator, 'n'))) " Normal mode (+ space, with line count) exe 'nmap '.g:better_whitespace_operator.' :exe ".,+".v:count" StripWhitespace"' " Other motions