aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2022-08-23 12:32:59 -0600
committerJosh Rahm <rahm@google.com>2022-08-23 12:32:59 -0600
commiteabc175e8d7649f0d3308e8bec57f876107b8335 (patch)
tree774bbaf3fd9823e980664bd11f93c98576d1e032
parent5e5cc5189d53443e82100d85926e5856e6506866 (diff)
downloadfieldmarshal.vim-eabc175e8d7649f0d3308e8bec57f876107b8335.tar.gz
fieldmarshal.vim-eabc175e8d7649f0d3308e8bec57f876107b8335.tar.bz2
fieldmarshal.vim-eabc175e8d7649f0d3308e8bec57f876107b8335.zip
Better handling for substitute and command.
-rw-r--r--plugin/command.vim2
-rw-r--r--plugin/substitute.vim3
2 files changed, 3 insertions, 2 deletions
diff --git a/plugin/command.vim b/plugin/command.vim
index 51633b5..db18cf3 100644
--- a/plugin/command.vim
+++ b/plugin/command.vim
@@ -10,5 +10,5 @@ function! s:do_command_around(str) abort
let [_, lnum0, _, _] = getpos("'[")
let [_, lnum1, _, _] = getpos("']")
- call feedkeys(printf(":%d,%d ", lnum0, lnum1))
+ call feedkeys(printf(":silent! %d,%d ", lnum0, lnum1))
endfunction
diff --git a/plugin/substitute.vim b/plugin/substitute.vim
index 982a76b..47de404 100644
--- a/plugin/substitute.vim
+++ b/plugin/substitute.vim
@@ -45,7 +45,8 @@ function! s:do_subst_priv(m0, m1, do_enter) abort
" backspace.
call feedkeys(
\ printf(
- \ ":%d,%d s/\\V%s%s%s/%s/g%s",
+ \ ":%s %d,%d s/\\V%s%s%s/%s/g%s",
+ \ a:do_enter ? "silent!" : "",
\ lnum0,
\ lnum1,
\ a:do_enter ? "\\<" : "",