diff options
author | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-08-06 11:46:46 -0400 |
---|---|---|
committer | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-08-06 11:49:59 -0400 |
commit | 47d52e1578aa6dd0b55d397d24fc929b95d586f2 (patch) | |
tree | d6fe01a8f0cfcdb05d619ab867b8af272d84239f /src | |
parent | b9ab3636362c67bb49f8cd165006c97ffc9a00da (diff) | |
download | rneovim-47d52e1578aa6dd0b55d397d24fc929b95d586f2.tar.gz rneovim-47d52e1578aa6dd0b55d397d24fc929b95d586f2.tar.bz2 rneovim-47d52e1578aa6dd0b55d397d24fc929b95d586f2.zip |
globals: did_ai is bool
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/edit.c | 19 | ||||
-rw-r--r-- | src/nvim/globals.h | 2 | ||||
-rw-r--r-- | src/nvim/misc1.c | 9 | ||||
-rw-r--r-- | src/nvim/ops.c | 2 |
4 files changed, 17 insertions, 15 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c index 6c2724381d..4db014af1b 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -4456,7 +4456,7 @@ static int ins_complete(int c, bool enable_pum) int save_w_wrow; int save_w_leftcol; int insert_match; - int save_did_ai = did_ai; + const bool save_did_ai = did_ai; compl_direction = ins_compl_key2dir(c); insert_match = ins_compl_use_match(c); @@ -4464,7 +4464,7 @@ static int ins_complete(int c, bool enable_pum) if (!compl_started) { /* First time we hit ^N or ^P (in a row, I mean) */ - did_ai = FALSE; + did_ai = false; did_si = false; can_si = false; can_si_back = false; @@ -5270,7 +5270,7 @@ insertchar ( } end_comment_pending = NUL; - did_ai = FALSE; + did_ai = false; did_si = false; can_si = false; can_si_back = false; @@ -5659,7 +5659,7 @@ internal_format ( haveto_redraw = true; can_cindent = true; // moved the cursor, don't autoindent or cindent now - did_ai = FALSE; + did_ai = false; did_si = false; can_si = false; can_si_back = false; @@ -6081,7 +6081,7 @@ stop_insert ( } } } - did_ai = FALSE; + did_ai = false; did_si = false; can_si = false; can_si_back = false; @@ -7464,8 +7464,9 @@ static void ins_shift(int c, int lastc) } else change_indent(c == Ctrl_D ? INDENT_DEC : INDENT_INC, 0, TRUE, 0, TRUE); - if (did_ai && *skipwhite(get_cursor_line_ptr()) != NUL) - did_ai = FALSE; + if (did_ai && *skipwhite(get_cursor_line_ptr()) != NUL) { + did_ai = false; + } did_si = false; can_si = false; can_si_back = false; @@ -7489,7 +7490,7 @@ static void ins_del(void) } else if (del_char(false) == FAIL) { // delete char under cursor vim_beep(BO_BS); } - did_ai = FALSE; + did_ai = false; did_si = false; can_si = false; can_si_back = false; @@ -7659,7 +7660,7 @@ static bool ins_bs(int c, int mode, int *inserted_space_p) State = oldState; } } - did_ai = FALSE; + did_ai = false; } else { /* * Delete character(s) before the cursor. diff --git a/src/nvim/globals.h b/src/nvim/globals.h index 8ae422f21b..a31f6950e9 100644 --- a/src/nvim/globals.h +++ b/src/nvim/globals.h @@ -604,7 +604,7 @@ EXTERN pos_T where_paste_started; * reset when any other editing is done on the line. If an <ESC> or <RETURN> * is received, and did_ai is TRUE, the line is truncated. */ -EXTERN int did_ai INIT(= FALSE); +EXTERN bool did_ai INIT(= false); /* * Column of first char after autoindent. 0 when no autoindent done. Used diff --git a/src/nvim/misc1.c b/src/nvim/misc1.c index c1899970e7..3108d0316c 100644 --- a/src/nvim/misc1.c +++ b/src/nvim/misc1.c @@ -332,7 +332,7 @@ open_line ( can_si = true; } - did_ai = TRUE; + did_ai = true; } /* @@ -710,8 +710,9 @@ open_line ( ++less_cols_off; } } - if (*p_extra != NUL) - did_ai = FALSE; /* append some text, don't truncate now */ + if (*p_extra != NUL) { + did_ai = false; // append some text, don't truncate now + } /* columns for marks adjusted for removed columns */ less_cols = (int)(p_extra - saved_line); @@ -738,7 +739,7 @@ open_line ( } STRCAT(leader, p_extra); p_extra = leader; - did_ai = TRUE; /* So truncating blanks works with comments */ + did_ai = true; // So truncating blanks works with comments less_cols -= lead_len; } else end_comment_pending = NUL; /* turns out there was no leader */ diff --git a/src/nvim/ops.c b/src/nvim/ops.c index 9107f1385e..2a83b7a4fc 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -1475,7 +1475,7 @@ int op_delete(oparg_T *oap) return FAIL; if (curbuf->b_p_ai) { /* don't delete indent */ beginline(BL_WHITE); /* cursor on first non-white */ - did_ai = TRUE; /* delete the indent when ESC hit */ + did_ai = true; // delete the indent when ESC hit ai_col = curwin->w_cursor.col; } else beginline(0); /* cursor in column 0 */ |