aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJustin M. Keyes <justinkz@gmail.com>2018-09-14 19:21:09 +0200
committerGitHub <noreply@github.com>2018-09-14 19:21:09 +0200
commitdadcfe22cab6c4c5e838c0127303bc81638b7283 (patch)
treef934c57f9587185b59effe605dfedca91a839596 /src
parentc03e8307d2eff687034b71d59c859e5c267661c8 (diff)
parenta6d4a2fb8d319b2639b38039f56f44728f4f8bc2 (diff)
downloadrneovim-dadcfe22cab6c4c5e838c0127303bc81638b7283.tar.gz
rneovim-dadcfe22cab6c4c5e838c0127303bc81638b7283.tar.bz2
rneovim-dadcfe22cab6c4c5e838c0127303bc81638b7283.zip
Merge #8998 from janlazo/vim-8.0.1275
Diffstat (limited to 'src')
-rw-r--r--src/nvim/ex_cmds.c2
-rw-r--r--src/nvim/ex_docmd.c6
-rw-r--r--src/nvim/ex_getln.c4
-rw-r--r--src/nvim/fileio.c2
-rw-r--r--src/nvim/fold.c3
-rw-r--r--src/nvim/getchar.c2
-rw-r--r--src/nvim/globals.h2
-rw-r--r--src/nvim/normal.c4
-rw-r--r--src/nvim/quickfix.c4
-rw-r--r--src/nvim/tag.c6
10 files changed, 18 insertions, 17 deletions
diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c
index 3e06b079ba..67c45e4360 100644
--- a/src/nvim/ex_cmds.c
+++ b/src/nvim/ex_cmds.c
@@ -4395,7 +4395,7 @@ void ex_help(exarg_T *eap)
buf_T *buf;
int len;
char_u *lang;
- int old_KeyTyped = KeyTyped;
+ const bool old_KeyTyped = KeyTyped;
if (eap != NULL) {
/*
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c
index 8445d27c8f..ac5de0733b 100644
--- a/src/nvim/ex_docmd.c
+++ b/src/nvim/ex_docmd.c
@@ -400,7 +400,7 @@ int do_cmdline(char_u *cmdline, LineGetter fgetline,
*/
if (!(flags & DOCMD_KEYTYPED)
&& !getline_equal(fgetline, cookie, getexline))
- KeyTyped = FALSE;
+ KeyTyped = false;
/*
* Continue executing command lines:
@@ -973,8 +973,8 @@ static char_u *get_loop_line(int c, void *cookie, int indent)
return line;
}
- KeyTyped = FALSE;
- ++cp->current_line;
+ KeyTyped = false;
+ cp->current_line++;
wp = (wcmd_T *)(cp->lines_gap->ga_data) + cp->current_line;
sourcing_lnum = wp->lnum;
return vim_strsave(wp->line);
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c
index c2559e051d..0bb704489b 100644
--- a/src/nvim/ex_getln.c
+++ b/src/nvim/ex_getln.c
@@ -623,7 +623,7 @@ static int command_line_execute(VimState *state, int key)
}
s->wim_index = 0;
if (p_wmnu && wild_menu_showing != 0) {
- int skt = KeyTyped;
+ const bool skt = KeyTyped;
int old_RedrawingDisabled = RedrawingDisabled;
if (ccline.input_fn) {
@@ -6108,7 +6108,7 @@ static int open_cmdwin(void)
RedrawingDisabled = i;
restore_batch_count(save_count);
- int save_KeyTyped = KeyTyped;
+ const bool save_KeyTyped = KeyTyped;
/* Trigger CmdwinLeave autocommands. */
apply_autocmds(EVENT_CMDWINLEAVE, typestr, typestr, FALSE, curbuf);
diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c
index 290de034d7..ae0b24f3c8 100644
--- a/src/nvim/fileio.c
+++ b/src/nvim/fileio.c
@@ -6707,6 +6707,7 @@ static bool apply_autocmds_group(event_T event, char_u *fname, char_u *fname_io,
proftime_T wait_time;
bool did_save_redobuff = false;
save_redo_T save_redo;
+ const bool save_KeyTyped = KeyTyped;
// Quickly return if there are no autocommands for this event or
// autocommands are blocked.
@@ -6966,6 +6967,7 @@ static bool apply_autocmds_group(event_T event, char_u *fname, char_u *fname_io,
restore_funccal(save_funccalp);
if (do_profiling == PROF_YES)
prof_child_exit(&wait_time);
+ KeyTyped = save_KeyTyped;
xfree(fname);
xfree(sfname);
--nesting; /* see matching increment above */
diff --git a/src/nvim/fold.c b/src/nvim/fold.c
index b00c45413a..53a3218c51 100644
--- a/src/nvim/fold.c
+++ b/src/nvim/fold.c
@@ -2883,7 +2883,6 @@ static void foldlevelExpr(fline_T *flp)
int n;
int c;
linenr_T lnum = flp->lnum + flp->off;
- int save_keytyped;
win = curwin;
curwin = flp->wp;
@@ -2898,7 +2897,7 @@ static void foldlevelExpr(fline_T *flp)
/* KeyTyped may be reset to 0 when calling a function which invokes
* do_cmdline(). To make 'foldopen' work correctly restore KeyTyped. */
- save_keytyped = KeyTyped;
+ const bool save_keytyped = KeyTyped;
n = (int)eval_foldexpr(flp->wp->w_p_fde, &c);
KeyTyped = save_keytyped;
diff --git a/src/nvim/getchar.c b/src/nvim/getchar.c
index 061b220f0e..2eb2df399e 100644
--- a/src/nvim/getchar.c
+++ b/src/nvim/getchar.c
@@ -1670,7 +1670,7 @@ static int vgetorpeek(int advance)
}
if (c != NUL && !got_int) {
if (advance) {
- // KeyTyped = FALSE; When the command that stuffed something
+ // KeyTyped = false; When the command that stuffed something
// was typed, behave like the stuffed command was typed.
// needed for CTRL-W CTRL-] to open a fold, for example.
KeyStuffed = true;
diff --git a/src/nvim/globals.h b/src/nvim/globals.h
index 3bb18d2b5f..b2e6233400 100644
--- a/src/nvim/globals.h
+++ b/src/nvim/globals.h
@@ -789,7 +789,7 @@ EXTERN int ex_normal_busy INIT(= 0); // recursiveness of ex_normal()
EXTERN int ex_normal_lock INIT(= 0); // forbid use of ex_normal()
EXTERN int ignore_script INIT(= false); // ignore script input
EXTERN int stop_insert_mode; // for ":stopinsert" and 'insertmode'
-EXTERN int KeyTyped; // TRUE if user typed current char
+EXTERN bool KeyTyped; // true if user typed current char
EXTERN int KeyStuffed; // TRUE if current char from stuffbuf
EXTERN int maptick INIT(= 0); // tick for each non-mapped char
diff --git a/src/nvim/normal.c b/src/nvim/normal.c
index 6b932c27d7..32d9e7e982 100644
--- a/src/nvim/normal.c
+++ b/src/nvim/normal.c
@@ -6297,7 +6297,7 @@ static void nv_gomark(cmdarg_T *cap)
pos_T *pos;
int c;
pos_T old_cursor = curwin->w_cursor;
- int old_KeyTyped = KeyTyped; /* getting file may reset it */
+ const bool old_KeyTyped = KeyTyped; // getting file may reset it
if (cap->cmdchar == 'g')
c = cap->extra_char;
@@ -6334,7 +6334,7 @@ static void nv_pcmark(cmdarg_T *cap)
{
pos_T *pos;
linenr_T lnum = curwin->w_cursor.lnum;
- int old_KeyTyped = KeyTyped; /* getting file may reset it */
+ const bool old_KeyTyped = KeyTyped; // getting file may reset it
if (!checkclearopq(cap->oap)) {
if (cap->cmdchar == 'g')
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c
index 7c555da1a0..89e0f40f4e 100644
--- a/src/nvim/quickfix.c
+++ b/src/nvim/quickfix.c
@@ -1759,7 +1759,7 @@ void qf_jump(qf_info_T *qi, int dir, int errornr, int forceit)
win_T *oldwin = curwin;
int print_message = TRUE;
int len;
- int old_KeyTyped = KeyTyped; /* getting file may reset it */
+ const bool old_KeyTyped = KeyTyped; // getting file may reset it
int ok = OK;
bool usable_win;
@@ -2932,7 +2932,7 @@ static void qf_fill_buffer(qf_info_T *qi, buf_T *buf, qfline_T *old_last)
qfline_T *qfp;
buf_T *errbuf;
int len;
- int old_KeyTyped = KeyTyped;
+ const bool old_KeyTyped = KeyTyped;
if (old_last == NULL) {
if (buf != curbuf) {
diff --git a/src/nvim/tag.c b/src/nvim/tag.c
index 54090afd71..50397d40e6 100644
--- a/src/nvim/tag.c
+++ b/src/nvim/tag.c
@@ -266,8 +266,8 @@ do_tag (
goto end_do_tag;
}
- if (type == DT_POP) { /* go to older position */
- int old_KeyTyped = KeyTyped;
+ if (type == DT_POP) { // go to older position
+ const bool old_KeyTyped = KeyTyped;
if ((tagstackidx -= count) < 0) {
EMSG(_(bottommsg));
if (tagstackidx + count == 0) {
@@ -2333,7 +2333,7 @@ static int jumpto_tag(
int save_no_hlsearch;
win_T *curwin_save = NULL;
char_u *full_fname = NULL;
- int old_KeyTyped = KeyTyped; /* getting the file may reset it */
+ const bool old_KeyTyped = KeyTyped; // getting the file may reset it
const int l_g_do_tagpreview = g_do_tagpreview;
const size_t len = matching_line_len(lbuf_arg) + 1;
char_u *lbuf = xmalloc(len);