aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_cmds.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2019-11-05 17:34:21 -0800
committerJustin M. Keyes <justinkz@gmail.com>2019-11-05 17:34:21 -0800
commit3e21d498362f8cfff7ee467be6402fb00a53eeb5 (patch)
treecffcd0e03a35fc4f8496e1eac084913c31bc5a1e /src/nvim/ex_cmds.c
parent610755ff62049bd38cc72524a26ac0a27d951c3c (diff)
parent4f124702c079fba4502b077c8c832538c0f0b386 (diff)
downloadrneovim-3e21d498362f8cfff7ee467be6402fb00a53eeb5.tar.gz
rneovim-3e21d498362f8cfff7ee467be6402fb00a53eeb5.tar.bz2
rneovim-3e21d498362f8cfff7ee467be6402fb00a53eeb5.zip
Merge #11319 'inccommand: fix issues with modifiers and prompting'
Diffstat (limited to 'src/nvim/ex_cmds.c')
-rw-r--r--src/nvim/ex_cmds.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index 04aa8f7ef6..1b6d9b50e9 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -5540,6 +5540,7 @@ static buf_T *show_sub(exarg_T *eap, pos_T old_cusr,
// We keep a special-purpose buffer around, but don't assume it exists.
buf_T *preview_buf = bufnr ? buflist_findnr(bufnr) : 0;
+ cmdmod.split = 0; // disable :leftabove/botright modifiers
cmdmod.tab = 0; // disable :tab modifier
cmdmod.noswapfile = true; // disable swap for preview buffer
// disable file info message
@@ -5586,6 +5587,9 @@ static buf_T *show_sub(exarg_T *eap, pos_T old_cusr,
highest_num_line = kv_last(lines.subresults).end.lnum;
col_width = log10(highest_num_line) + 1 + 3;
}
+ } else {
+ // Failed to split the window, don't show 'inccommand' preview.
+ preview_buf = NULL;
}
char *str = NULL; // construct the line to show in here
@@ -5598,7 +5602,7 @@ static buf_T *show_sub(exarg_T *eap, pos_T old_cusr,
for (size_t matchidx = 0; matchidx < lines.subresults.size; matchidx++) {
SubResult match = lines.subresults.items[matchidx];
- if (split && preview_buf) {
+ if (preview_buf) {
lpos_T p_start = { 0, match.start.col }; // match starts here in preview
lpos_T p_end = { 0, match.end.col }; // ... and ends here