aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ex_getln.c
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-02-02 23:26:16 +0100
committerJustin M. Keyes <justinkz@gmail.com>2018-02-11 15:29:19 +0100
commitcebf31cf705e32ed3b3ac2202884ab6b360f6c52 (patch)
tree6b6337b269a47096db41eadf5365c2b42f20045c /src/nvim/ex_getln.c
parent2de447b60c04fcaad3d762851c512b2545ea6bad (diff)
downloadrneovim-cebf31cf705e32ed3b3ac2202884ab6b360f6c52.tar.gz
rneovim-cebf31cf705e32ed3b3ac2202884ab6b360f6c52.tar.bz2
rneovim-cebf31cf705e32ed3b3ac2202884ab6b360f6c52.zip
vim-patch:8.0.1210: CTRL-G and CTRL-T are ignored with typeahead
Problem: When typing a search pattern CTRL-G and CTRL-T are ignored when there is typeahead. Solution: Don't pass SEARCH_PEEK and don't call char_avail(). (haya14busa, closes vim/vim#2233) https://github.com/vim/vim/commit/f8e8c0643b1cd97db11912bc4f773e1328a0da02
Diffstat (limited to 'src/nvim/ex_getln.c')
-rw-r--r--src/nvim/ex_getln.c25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index c99ae687bb..6b13a57980 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -443,14 +443,8 @@ static uint8_t *command_line_enter(int firstc, long count, int indent)
}
}
- if (s->gotesc) { // abandon command line
- xfree(ccline.cmdbuff);
- ccline.cmdbuff = NULL;
- if (msg_scrolled == 0) {
- compute_cmdrow();
- }
- MSG("");
- redraw_cmdline = true;
+ if (s->gotesc) {
+ abandon_cmdline();
}
}
@@ -1680,9 +1674,6 @@ static int command_line_handle_key(CommandLineState *s)
case Ctrl_G: // next match
case Ctrl_T: // previous match
if (p_is && !cmd_silent && (s->firstc == '/' || s->firstc == '?')) {
- if (char_avail()) {
- return 1;
- }
if (ccline.cmdlen != 0) {
command_line_next_incsearch(s, s->c == Ctrl_G);
}
@@ -1948,6 +1939,18 @@ static int command_line_changed(CommandLineState *s)
return 1;
}
+/// Abandon the command line.
+static void abandon_cmdline(void)
+{
+ xfree(ccline.cmdbuff);
+ ccline.cmdbuff = NULL;
+ if (msg_scrolled == 0) {
+ compute_cmdrow();
+ }
+ MSG("");
+ redraw_cmdline = true;
+}
+
/*
* getcmdline() - accept a command line starting with firstc.
*