refactor(fold): style #19175

* refactor(fold): update comment formatting
* refactor(fold): use post-increment/decrement
* refactor(fold): reduce scope of local variables
* refactor(fold): use booleans
This commit is contained in:
Lewis Russell
2022-07-02 12:29:27 +01:00
committed by GitHub
parent 662681694b
commit ed429c00d7
4 changed files with 232 additions and 312 deletions

View File

@@ -2341,7 +2341,7 @@ static char *do_one_cmd(char **cmdlinep, int flags, cstack_T *cstack, LineGetter
do_return(&ea, TRUE, FALSE, NULL); do_return(&ea, TRUE, FALSE, NULL);
} }
} }
need_rethrow = check_cstack = FALSE; need_rethrow = check_cstack = false;
doend: doend:
// can happen with zero line number // can happen with zero line number

File diff suppressed because it is too large Load Diff

View File

@@ -224,7 +224,7 @@ EXTERN dict_T vimvardict; // Dictionary with v: variables
EXTERN dict_T globvardict; // Dictionary with g: variables EXTERN dict_T globvardict; // Dictionary with g: variables
/// g: value /// g: value
#define globvarht globvardict.dv_hashtab #define globvarht globvardict.dv_hashtab
EXTERN int did_emsg; // set by emsg() when the message EXTERN bool did_emsg; // set by emsg() when the message
// is displayed or thrown // is displayed or thrown
EXTERN bool called_vim_beep; // set if vim_beep() is called EXTERN bool called_vim_beep; // set if vim_beep() is called
EXTERN bool did_emsg_syntax; // did_emsg set because of a EXTERN bool did_emsg_syntax; // did_emsg set because of a
@@ -274,11 +274,11 @@ EXTERN except_T *current_exception;
/// Set when a throw that cannot be handled in do_cmdline() must be propagated /// Set when a throw that cannot be handled in do_cmdline() must be propagated
/// to the cstack of the previously called do_cmdline(). /// to the cstack of the previously called do_cmdline().
EXTERN int need_rethrow INIT(= false); EXTERN bool need_rethrow INIT(= false);
/// Set when a ":finish" or ":return" that cannot be handled in do_cmdline() /// Set when a ":finish" or ":return" that cannot be handled in do_cmdline()
/// must be propagated to the cstack of the previously called do_cmdline(). /// must be propagated to the cstack of the previously called do_cmdline().
EXTERN int check_cstack INIT(= false); EXTERN bool check_cstack INIT(= false);
/// Number of nested try conditionals (across function calls and ":source" /// Number of nested try conditionals (across function calls and ":source"
/// commands). /// commands).
@@ -725,8 +725,7 @@ EXTERN bool need_highlight_changed INIT(= true);
EXTERN FILE *scriptout INIT(= NULL); ///< Stream to write script to. EXTERN FILE *scriptout INIT(= NULL); ///< Stream to write script to.
// volatile because it is used in a signal handler. // volatile because it is used in a signal handler.
EXTERN volatile int got_int INIT(= false); // set to true when interrupt EXTERN bool got_int INIT(= false); // set to true when interrupt signal occurred
// signal occurred
EXTERN bool bangredo INIT(= false); // set to true with ! command EXTERN bool bangredo INIT(= false); // set to true with ! command
EXTERN int searchcmdlen; // length of previous search cmd EXTERN int searchcmdlen; // length of previous search cmd
EXTERN int reg_do_extmatch INIT(= 0); // Used when compiling regexp: EXTERN int reg_do_extmatch INIT(= 0); // Used when compiling regexp:

View File

@@ -652,7 +652,7 @@ static bool emsg_multiline(const char *s, bool multiline)
// interrupt message). // interrupt message).
if (cause_errthrow(s, severe, &ignore)) { if (cause_errthrow(s, severe, &ignore)) {
if (!ignore) { if (!ignore) {
did_emsg++; did_emsg = true;
} }
return true; return true;
} }
@@ -717,7 +717,7 @@ static bool emsg_multiline(const char *s, bool multiline)
} else { } else {
flush_buffers(FLUSH_MINIMAL); // flush internal buffers flush_buffers(FLUSH_MINIMAL); // flush internal buffers
} }
did_emsg++; // flag for DoOneCmd() did_emsg = true; // flag for DoOneCmd()
} }
emsg_on_display = true; // remember there is an error message emsg_on_display = true; // remember there is an error message