diff options
-rw-r--r-- | src/nvim/edit.c | 12 | ||||
-rw-r--r-- | src/nvim/globals.h | 2 | ||||
-rw-r--r-- | src/nvim/misc1.c | 13 |
3 files changed, 14 insertions, 13 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c index 99ab991d51..6c2724381d 100644 --- a/src/nvim/edit.c +++ b/src/nvim/edit.c @@ -4465,7 +4465,7 @@ static int ins_complete(int c, bool enable_pum) /* First time we hit ^N or ^P (in a row, I mean) */ did_ai = FALSE; - did_si = FALSE; + did_si = false; can_si = false; can_si_back = false; if (stop_arrow() == FAIL) { @@ -5271,7 +5271,7 @@ insertchar ( end_comment_pending = NUL; did_ai = FALSE; - did_si = FALSE; + did_si = false; can_si = false; can_si_back = false; @@ -5660,7 +5660,7 @@ internal_format ( can_cindent = true; // moved the cursor, don't autoindent or cindent now did_ai = FALSE; - did_si = FALSE; + did_si = false; can_si = false; can_si_back = false; line_breakcheck(); @@ -6082,7 +6082,7 @@ stop_insert ( } } did_ai = FALSE; - did_si = FALSE; + did_si = false; can_si = false; can_si_back = false; @@ -7466,7 +7466,7 @@ static void ins_shift(int c, int lastc) if (did_ai && *skipwhite(get_cursor_line_ptr()) != NUL) did_ai = FALSE; - did_si = FALSE; + did_si = false; can_si = false; can_si_back = false; can_cindent = false; // no cindenting after ^D or ^T @@ -7490,7 +7490,7 @@ static void ins_del(void) vim_beep(BO_BS); } did_ai = FALSE; - did_si = FALSE; + did_si = false; can_si = false; can_si_back = false; AppendCharToRedobuff(K_DEL); diff --git a/src/nvim/globals.h b/src/nvim/globals.h index 25a82c07d4..8ae422f21b 100644 --- a/src/nvim/globals.h +++ b/src/nvim/globals.h @@ -632,7 +632,7 @@ EXTERN int did_syncbind INIT(= FALSE); * This flag is set when a smart indent has been performed. When the next typed * character is a '{' the inserted tab will be deleted again. */ -EXTERN int did_si INIT(= FALSE); +EXTERN bool did_si INIT(= false); /* * This flag is set after an auto indent. If the next typed character is a '}' diff --git a/src/nvim/misc1.c b/src/nvim/misc1.c index 3a2795f530..c1899970e7 100644 --- a/src/nvim/misc1.c +++ b/src/nvim/misc1.c @@ -166,7 +166,7 @@ open_line ( } u_clearline(); /* cannot do "U" command when adding lines */ - did_si = FALSE; + did_si = false; ai_col = 0; /* @@ -286,7 +286,7 @@ open_line ( * checking for "if" and the like. */ if (last_char == '{') { - did_si = TRUE; /* do indent */ + did_si = true; // do indent no_si = TRUE; /* don't delete it when '{' typed */ } /* @@ -296,7 +296,7 @@ open_line ( */ else if (last_char != ';' && last_char != '}' && cin_is_cinword(ptr)) - did_si = TRUE; + did_si = true; } } else { // dir == BACKWARD // Skip preprocessor directives, unless they are @@ -321,7 +321,7 @@ open_line ( } p = skipwhite(ptr); if (*p == '}') { // if line starts with '}': do indent - did_si = TRUE; + did_si = true; } else { // can delete indent when '{' typed can_si_back = true; } @@ -814,8 +814,9 @@ open_line ( } } newcol += curwin->w_cursor.col; - if (no_si) - did_si = FALSE; + if (no_si) { + did_si = false; + } } /* |