From e88977e58311caee518af869a3afcd0460048d64 Mon Sep 17 00:00:00 2001 From: Tuure Piitulainen Date: Mon, 3 Nov 2025 20:51:33 +0200 Subject: [PATCH] Fix dot-repeats showing noise on the cmdline Resolves https://github.com/chaoren/vim-wordmotion/issues/20 --- plugin/wordmotion.vim | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/plugin/wordmotion.vim b/plugin/wordmotion.vim index 8aa633d..3c79971 100644 --- a/plugin/wordmotion.vim +++ b/plugin/wordmotion.vim @@ -52,7 +52,12 @@ for s:_.motion in s:_.motions let s:_.f = printf("'%s'", s:_.flags[tolower(s:_.motion)]) let s:_.u = s:_.motion =~# '\u' let s:_.args = join(['v:count1', s:_.m, s:_.f, s:_.u, '[]'], ', ') - let s:_.rhs = printf(':call wordmotion#motion(%s)', s:_.args) + if s:_.mode ==# 'x' + let s:_.rhs = printf(':call wordmotion#motion(%s)', s:_.args) + else + " avoid showing the cmdline call in dot-repeat + let s:_.rhs = printf('call wordmotion#motion(%s)', s:_.args) + endif execute s:_.mode . 'noremap' '' s:_.map s:_.rhs call s:_.add_existing(s:_.mode, s:_.map, s:_.rhs) if s:_.nomap @@ -80,7 +85,12 @@ for s:_.motion in s:_.motions let s:_.i = s:_.inner[tolower(s:_.motion)] let s:_.u = s:_.motion =~# '\u' let s:_.args = join(['v:count1', s:_.m, s:_.i, s:_.u], ', ') - let s:_.rhs = printf(':call wordmotion#object(%s)', s:_.args) + if s:_.mode ==# 'x' + let s:_.rhs = printf(':call wordmotion#object(%s)', s:_.args) + else + " avoid showing the cmdline call in dot-repeat + let s:_.rhs = printf('call wordmotion#object(%s)', s:_.args) + endif execute s:_.mode . 'noremap' '' s:_.map s:_.rhs call s:_.add_existing(s:_.mode, s:_.map, s:_.rhs) if s:_.nomap