From 5f03a1eaabfc8de2b3a9c666fcd604763f41e152 Mon Sep 17 00:00:00 2001 From: dundargoc Date: Fri, 20 Oct 2023 15:10:33 +0200 Subject: build(lint): remove unnecessary clint.py rules Uncrustify is the source of truth where possible. Remove any redundant checks from clint.py. --- src/clint.py | 272 ++------------------- src/nvim/api/extmark.h | 4 +- src/nvim/api/private/helpers.h | 6 +- src/nvim/api/vim.c | 4 +- src/nvim/autocmd.h | 6 +- src/nvim/buffer.h | 4 +- src/nvim/buffer_defs.h | 8 +- src/nvim/bufwrite.c | 2 +- src/nvim/channel.h | 4 +- src/nvim/decoration.h | 8 +- src/nvim/decoration_provider.h | 2 +- src/nvim/diff.c | 8 +- src/nvim/diff.h | 8 +- src/nvim/drawline.c | 16 +- src/nvim/drawline.h | 4 +- src/nvim/drawscreen.h | 4 +- src/nvim/eval.h | 2 +- src/nvim/eval/funcs.c | 14 +- src/nvim/eval/typval.c | 26 +- src/nvim/eval/typval.h | 4 +- src/nvim/event/socket.c | 2 +- src/nvim/ex_cmds.c | 8 +- src/nvim/ex_docmd.c | 31 ++- src/nvim/extmark.h | 2 +- src/nvim/file_search.c | 10 +- src/nvim/fold.c | 2 +- src/nvim/fold.h | 2 +- src/nvim/func_attr.h | 2 +- src/nvim/globals.h | 530 ++++++++++++++++++++--------------------- src/nvim/grid.h | 10 +- src/nvim/highlight.c | 4 +- src/nvim/highlight_defs.h | 22 +- src/nvim/highlight_group.c | 2 +- src/nvim/lua/executor.h | 4 +- src/nvim/lua/stdlib.c | 2 +- src/nvim/lua/treesitter.c | 4 +- src/nvim/lua/xdiff.c | 10 +- src/nvim/map.c | 4 +- src/nvim/mark.c | 6 +- src/nvim/mark_defs.h | 2 +- src/nvim/memline.c | 2 +- src/nvim/memory.h | 2 +- src/nvim/message.h | 14 +- src/nvim/move.c | 10 +- src/nvim/msgpack_rpc/channel.h | 2 +- src/nvim/ops.h | 2 +- src/nvim/option.c | 2 +- src/nvim/option_vars.h | 4 +- src/nvim/os/input.h | 2 +- src/nvim/os/pty_conpty_win.c | 6 +- src/nvim/os/pty_conpty_win.h | 6 +- src/nvim/os/pty_process_unix.c | 28 +-- src/nvim/os/shell.c | 8 +- src/nvim/popupmenu.h | 2 +- src/nvim/profile.c | 44 ++-- src/nvim/quickfix.c | 2 +- src/nvim/regexp_nfa.c | 10 +- src/nvim/search.c | 8 +- src/nvim/sha256.c | 2 +- src/nvim/shada.c | 2 +- src/nvim/sign.c | 8 +- src/nvim/spellsuggest.c | 4 +- src/nvim/statusline.c | 6 +- src/nvim/statusline.h | 4 +- src/nvim/syntax.c | 2 +- src/nvim/terminal.c | 10 +- src/nvim/textformat.c | 4 +- src/nvim/ui.h | 2 +- src/nvim/ui_client.h | 16 +- src/nvim/window.c | 6 +- src/nvim/window.h | 2 +- src/uncrustify.cfg | 22 +- 72 files changed, 539 insertions(+), 770 deletions(-) (limited to 'src') diff --git a/src/clint.py b/src/clint.py index ee2d0ecc3c..0b72317305 100755 --- a/src/clint.py +++ b/src/clint.py @@ -45,7 +45,7 @@ import re import string import sys import json -import collections # for defaultdict +import collections _USAGE = """ @@ -149,10 +149,8 @@ Syntax: clint.py [--verbose=#] [--output=vs7] [--filter=-x,+y,...] # If you add a new error message with a new category, add it to the list # here! cpplint_unittest.py should tell you if you forget to do this. _ERROR_CATEGORIES = [ - 'build/deprecated', 'build/endif_comment', 'build/header_guard', - 'build/include_alpha', 'build/printf_format', 'build/storage_class', 'readability/bool', @@ -169,14 +167,10 @@ _ERROR_CATEGORIES = [ 'runtime/printf_format', 'runtime/threadsafe_fn', 'runtime/deprecated', - 'syntax/parenthesis', 'whitespace/alignment', - 'whitespace/braces', 'whitespace/comments', 'whitespace/indent', - 'whitespace/newline', 'whitespace/operators', - 'whitespace/parens', 'whitespace/todo', 'whitespace/cast', ] @@ -185,7 +179,7 @@ _ERROR_CATEGORIES = [ # flag. By default all errors are on, so only add here categories that should be # off by default (i.e., categories that must be enabled by the --filter= flags). # All entries here should start with a '-' or '+', as in the --filter= flag. -_DEFAULT_FILTERS = ['-build/include_alpha'] +_DEFAULT_FILTERS = [] # These constants define the current inline assembly state _NO_ASM = 0 # Outside of inline assembly block @@ -480,38 +474,6 @@ def _SetFilters(filters): _cpplint_state.SetFilters(filters) -class _FunctionState: - - """Tracks current function name and the number of lines in its body.""" - - _NORMAL_TRIGGER = 250 # for --v=0, 500 for --v=1, etc. - _TEST_TRIGGER = 400 # about 50% more than _NORMAL_TRIGGER. - - def __init__(self): - self.in_a_function = False - self.lines_in_function = 0 - self.current_function = '' - - def Begin(self, function_name): - """Start analyzing function body. - - Args: - function_name: The name of the function being tracked. - """ - self.in_a_function = True - self.lines_in_function = 0 - self.current_function = function_name - - def Count(self): - """Count line in current function body.""" - if self.in_a_function: - self.lines_in_function += 1 - - def End(self): - """Stop analyzing function body.""" - self.in_a_function = False - - class FileInfo: """Provides utility functions for filenames. @@ -1544,82 +1506,6 @@ def CheckForNonStandardConstructs(filename, clean_lines, linenum, error): error(filename, linenum, 'build/endif_comment', 5, 'Uncommented text after #endif is non-standard. Use a comment.') - if Search(r'(\w+|[+-]?\d+(\.\d*)?)\s*(<|>)\?=?\s*(\w+|[+-]?\d+)(\.\d*)?', - line): - error(filename, linenum, 'build/deprecated', 3, - '>? and . match = Search(r'[^<>=!\s](==|!=|<=|>=)[^<>=!\s]', line) if match: - error(filename, linenum, 'whitespace/operators', 3, - 'Missing spaces around %s' % match.group(1)) + return # Boolean operators should be placed on the next line. if Search(r'(?:&&|\|\|)$', line): - error(filename, linenum, 'whitespace/operators', 4, - 'Boolean operator should be placed on the same line as the start ' - 'of its right operand') + return # We allow no-spaces around << when used like this: 10<<20, but # not otherwise (particularly, not when used as streams) @@ -2113,8 +1922,7 @@ def CheckSpacing(filename, clean_lines, linenum, error): match = Search(r'[^\s<]<([^\s=<].*)', reduced_line) if (match and not FindNextMatchingAngleBracket(clean_lines, linenum, match.group(1))): - error(filename, linenum, 'whitespace/operators', 3, - 'Missing spaces around <') + return # Look for > that is not surrounded by spaces. Similar to the # above, we only trigger if both sides are missing spaces to avoid @@ -2123,8 +1931,7 @@ def CheckSpacing(filename, clean_lines, linenum, error): if (match and not FindPreviousMatchingAngleBracket(clean_lines, linenum, match.group(1))): - error(filename, linenum, 'whitespace/operators', 3, - 'Missing spaces around >') + return # We allow no-spaces around >> for almost anything. This is because # C++11 allows ">>" to close nested templates, which accounts for @@ -2162,15 +1969,9 @@ def CheckSpacing(filename, clean_lines, linenum, error): if not (match.group(3) == ';' and len(match.group(2)) == 1 + len(match.group(4)) or not match.group(2) and Search(r'\bfor\s*\(.*; \)', line)): - error(filename, linenum, 'whitespace/parens', 5, - 'Mismatching spaces inside () in %s' % match.group(1)) + return if len(match.group(2)) not in [0, 1]: - error(filename, linenum, 'whitespace/parens', 5, - 'Should have zero or one spaces inside ( and ) in %s' % - match.group(1)) - - # Next we will look for issues with function calls. - CheckSpacingForFunctionCall(filename, line, linenum, error) + return # Check whether everything inside expressions is aligned correctly if any(line.find(k) >= 0 for k in BRACES if k != '{'): @@ -2219,21 +2020,17 @@ def CheckSpacing(filename, clean_lines, linenum, error): # Make sure '} else {' has spaces. if Search(r'}else', line): - error(filename, linenum, 'whitespace/braces', 5, - 'Missing space before else') + return # You shouldn't have spaces before your brackets, except maybe after # 'delete []' or 'new char * []'. if Search(r'\w\s+\[', line): - error(filename, linenum, 'whitespace/braces', 5, - 'Extra space before [') + return if Search(r'\{(?!\})\S', line): - error(filename, linenum, 'whitespace/braces', 5, - 'Missing space after {') + return if Search(r'\S(? 20) complain = 0; - # if(match($0, " +(error|private|public|protected):")) complain = 0; - # if(match(prev, "&& *$")) complain = 0; - # if(match(prev, "\\|\\| *$")) complain = 0; - # if(match(prev, "[\",=><] *$")) complain = 0; - # if(match($0, " <<")) complain = 0; - # if(match(prev, " +for \\(")) complain = 0; - # if(prevodd && match(prevprev, " +for \\(")) complain = 0; - initial_spaces = 0 - - while initial_spaces < len(line) and line[initial_spaces] == ' ': - initial_spaces += 1 - # Some more style checks CheckBraces(filename, clean_lines, linenum, error) CheckSpacing(filename, clean_lines, linenum, error) @@ -2612,7 +2385,7 @@ def CheckLanguage(filename, clean_lines, linenum, error): def ProcessLine(filename, clean_lines, line, - function_state, nesting_state, error, + nesting_state, error, extra_check_functions=[]): """Processes a single line in the file. @@ -2621,8 +2394,6 @@ def ProcessLine(filename, clean_lines, line, clean_lines : An array of strings, each representing a line of the file, with comments stripped. line : Number of line being processed. - function_state : A _FunctionState instance which counts function - lines, etc. nesting_state : A _NestingState instance which maintains information about the current stack of nested blocks being parsed. @@ -2639,7 +2410,6 @@ def ProcessLine(filename, clean_lines, line, nesting_state.Update(clean_lines, line) if nesting_state.stack and nesting_state.stack[-1].inline_asm != _NO_ASM: return - CheckForFunctionLengths(filename, clean_lines, line, function_state, error) CheckForMultilineCommentsAndStrings(filename, clean_lines, line, error) CheckForOldStyleComments(filename, init_lines[line], line, error) CheckStyle(filename, clean_lines, line, error) @@ -2670,7 +2440,6 @@ def ProcessFileData(filename, file_extension, lines, error, lines = (['// marker so line numbers and indices both start at 1'] + lines + ['// marker so line numbers end in a known way']) - function_state = _FunctionState() nesting_state = _NestingState() ResetNolintSuppressions() @@ -2700,7 +2469,7 @@ def ProcessFileData(filename, file_extension, lines, error, clean_lines = CleansedLines(lines, init_lines) for line in range(clean_lines.NumLines()): ProcessLine(filename, clean_lines, line, - function_state, nesting_state, error, + nesting_state, error, extra_check_functions) # We check here rather than inside ProcessLine so that we see raw @@ -2744,12 +2513,10 @@ def ProcessFile(filename, vlevel, extra_check_functions=[]): lines = codecs.open( filename, 'r', 'utf8', 'replace').read().split('\n') - carriage_return_found = False # Remove trailing '\r'. for linenum in range(len(lines)): if lines[linenum].endswith('\r'): lines[linenum] = lines[linenum].rstrip('\r') - carriage_return_found = True except OSError: sys.stderr.write( @@ -2768,13 +2535,6 @@ def ProcessFile(filename, vlevel, extra_check_functions=[]): else: ProcessFileData(filename, file_extension, lines, Error, extra_check_functions) - if carriage_return_found and os.linesep != '\r\n': - # Use 0 for linenum since outputting only one error for potentially - # several lines. - Error(filename, 0, 'whitespace/newline', 1, - 'One or more unexpected \\r (^M) found;' - 'better to use only a \\n') - def PrintUsage(message): """Prints a brief usage string and exits, optionally with an error message. diff --git a/src/nvim/api/extmark.h b/src/nvim/api/extmark.h index a7baad496f..7c300350e1 100644 --- a/src/nvim/api/extmark.h +++ b/src/nvim/api/extmark.h @@ -8,8 +8,8 @@ #include "nvim/map.h" #include "nvim/types.h" -EXTERN Map(String, int) namespace_ids INIT(= MAP_INIT); -EXTERN handle_T next_namespace_id INIT(= 1); +EXTERN Map(String, int) namespace_ids INIT( = MAP_INIT); +EXTERN handle_T next_namespace_id INIT( = 1); #ifdef INCLUDE_GENERATED_DECLARATIONS # include "api/extmark.h.generated.h" diff --git a/src/nvim/api/private/helpers.h b/src/nvim/api/private/helpers.h index e5ad30a10f..9cf4620acd 100644 --- a/src/nvim/api/private/helpers.h +++ b/src/nvim/api/private/helpers.h @@ -128,9 +128,9 @@ #define api_free_window(value) #define api_free_tabpage(value) -EXTERN PMap(int) buffer_handles INIT(= MAP_INIT); -EXTERN PMap(int) window_handles INIT(= MAP_INIT); -EXTERN PMap(int) tabpage_handles INIT(= MAP_INIT); +EXTERN PMap(int) buffer_handles INIT( = MAP_INIT); +EXTERN PMap(int) window_handles INIT( = MAP_INIT); +EXTERN PMap(int) tabpage_handles INIT( = MAP_INIT); #define handle_get_buffer(h) pmap_get(int)(&buffer_handles, (h)) #define handle_get_window(h) pmap_get(int)(&window_handles, (h)) diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index 6ce1f41e39..52022cba5d 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -2197,8 +2197,8 @@ Dictionary nvim_eval_statusline(String str, Dict(eval_statusline) *opts, Error * } if (statuscol_lnum) { HlPriId line = { 0 }; - HlPriId cul = { 0 }; - HlPriId num = { 0 }; + HlPriId cul = { 0 }; + HlPriId num = { 0 }; linenr_T lnum = statuscol_lnum; int num_signs = buf_get_signattrs(wp->w_buffer, lnum, sattrs, &num, &line, &cul); decor_redraw_signs(wp->w_buffer, lnum - 1, &num_signs, sattrs, &num, &line, &cul); diff --git a/src/nvim/autocmd.h b/src/nvim/autocmd.h index 324a31be47..0992fca929 100644 --- a/src/nvim/autocmd.h +++ b/src/nvim/autocmd.h @@ -79,12 +79,12 @@ typedef kvec_t(AutoCmd) AutoCmdVec; // // Relying on this value requires one to reset it prior calling // apply_autocmds_group. -EXTERN bool au_did_filetype INIT(= false); +EXTERN bool au_did_filetype INIT( = false); /// For CursorMoved event -EXTERN win_T *last_cursormoved_win INIT(= NULL); +EXTERN win_T *last_cursormoved_win INIT( = NULL); /// For CursorMoved event, only used when last_cursormoved_win == curwin -EXTERN pos_T last_cursormoved INIT(= { 0, 0, 0 }); +EXTERN pos_T last_cursormoved INIT( = { 0, 0, 0 }); #ifdef INCLUDE_GENERATED_DECLARATIONS # include "autocmd.h.generated.h" diff --git a/src/nvim/buffer.h b/src/nvim/buffer.h index 10d35ffc7e..2351ddc61b 100644 --- a/src/nvim/buffer.h +++ b/src/nvim/buffer.h @@ -69,8 +69,8 @@ enum bfa_values { BFA_IGNORE_ABORT = 8, // do not abort for aborting() }; -EXTERN char *msg_loclist INIT(= N_("[Location List]")); -EXTERN char *msg_qflist INIT(= N_("[Quickfix List]")); +EXTERN char *msg_loclist INIT( = N_("[Location List]")); +EXTERN char *msg_qflist INIT( = N_("[Quickfix List]")); #ifdef INCLUDE_GENERATED_DECLARATIONS # include "buffer.h.generated.h" diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h index 5b223daeb0..812ac60eb0 100644 --- a/src/nvim/buffer_defs.h +++ b/src/nvim/buffer_defs.h @@ -361,7 +361,7 @@ typedef struct { #define BUF_UPDATE_CALLBACKS_INIT { LUA_NOREF, LUA_NOREF, LUA_NOREF, \ LUA_NOREF, LUA_NOREF, false, false } -EXTERN int curbuf_splice_pending INIT(= 0); +EXTERN int curbuf_splice_pending INIT( = 0); #define BUF_HAS_QF_ENTRY 1 #define BUF_HAS_LL_ENTRY 2 @@ -913,7 +913,7 @@ enum { // NE -> kFloatAnchorEast // SW -> kFloatAnchorSouth // SE -> kFloatAnchorSouth | kFloatAnchorEast -EXTERN const char *const float_anchor_str[] INIT(= { "NW", "NE", "SW", "SE" }); +EXTERN const char *const float_anchor_str[] INIT( = { "NW", "NE", "SW", "SE" }); typedef enum { kFloatRelativeEditor = 0, @@ -922,8 +922,8 @@ typedef enum { kFloatRelativeMouse = 3, } FloatRelative; -EXTERN const char *const float_relative_str[] INIT(= { "editor", "win", - "cursor", "mouse" }); +EXTERN const char *const float_relative_str[] INIT( = { "editor", "win", + "cursor", "mouse" }); typedef enum { kWinStyleUnused = 0, diff --git a/src/nvim/bufwrite.c b/src/nvim/bufwrite.c index c151da7ab7..a3d05f28be 100644 --- a/src/nvim/bufwrite.c +++ b/src/nvim/bufwrite.c @@ -818,7 +818,7 @@ static int buf_write_make_backup(char *fname, bool append, FileInfo *file_info_o while (*dirp) { // Isolate one directory name, using an entry in 'bdir'. size_t dir_len = copy_option_part(&dirp, IObuff, IOSIZE, ","); - char *p = IObuff + dir_len; + char *p = IObuff + dir_len; bool trailing_pathseps = after_pathsep(IObuff, p) && p[-1] == p[-2]; if (trailing_pathseps) { IObuff[dir_len - 2] = NUL; diff --git a/src/nvim/channel.h b/src/nvim/channel.h index deb693373c..281e1aa2be 100644 --- a/src/nvim/channel.h +++ b/src/nvim/channel.h @@ -108,9 +108,9 @@ struct Channel { bool callback_scheduled; }; -EXTERN PMap(uint64_t) channels INIT(= MAP_INIT); +EXTERN PMap(uint64_t) channels INIT( = MAP_INIT); -EXTERN Callback on_print INIT(= CALLBACK_INIT); +EXTERN Callback on_print INIT( = CALLBACK_INIT); #ifdef INCLUDE_GENERATED_DECLARATIONS # include "channel.h.generated.h" diff --git a/src/nvim/decoration.h b/src/nvim/decoration.h index fef5ff7c2a..b82beaeef3 100644 --- a/src/nvim/decoration.h +++ b/src/nvim/decoration.h @@ -26,8 +26,8 @@ typedef enum { kVTInline, } VirtTextPos; -EXTERN const char *const virt_text_pos_str[] INIT(= { "eol", "overlay", "win_col", "right_align", - "inline" }); +EXTERN const char *const virt_text_pos_str[] INIT( = { "eol", "overlay", "win_col", "right_align", + "inline" }); typedef enum { kHlModeUnknown, @@ -36,7 +36,7 @@ typedef enum { kHlModeBlend, } HlMode; -EXTERN const char *const hl_mode_str[] INIT(= { "", "replace", "combine", "blend" }); +EXTERN const char *const hl_mode_str[] INIT( = { "", "replace", "combine", "blend" }); #define VIRTTEXT_EMPTY ((VirtText)KV_INITIAL_VALUE) @@ -114,7 +114,7 @@ typedef struct { bool running_on_lines; } DecorState; -EXTERN DecorState decor_state INIT(= { 0 }); +EXTERN DecorState decor_state INIT( = { 0 }); static inline bool decor_has_sign(Decoration *decor) { diff --git a/src/nvim/decoration_provider.h b/src/nvim/decoration_provider.h index ad2cdd564d..2ee476ba45 100644 --- a/src/nvim/decoration_provider.h +++ b/src/nvim/decoration_provider.h @@ -29,7 +29,7 @@ typedef struct { typedef kvec_withinit_t(DecorProvider *, 4) DecorProviders; -EXTERN bool provider_active INIT(= false); +EXTERN bool provider_active INIT( = false); #ifdef INCLUDE_GENERATED_DECLARATIONS # include "decoration_provider.h.generated.h" diff --git a/src/nvim/diff.c b/src/nvim/diff.c index b0663416ef..c76e6aaa2f 100644 --- a/src/nvim/diff.c +++ b/src/nvim/diff.c @@ -2950,7 +2950,7 @@ void ex_diffgetput(exarg_T *eap) } const int idx_from = eap->cmdidx == CMD_diffget ? idx_other : idx_cur; - const int idx_to = eap->cmdidx == CMD_diffget ? idx_cur : idx_other; + const int idx_to = eap->cmdidx == CMD_diffget ? idx_cur : idx_other; // May give the warning for a changed buffer here, which can trigger the // FileChangedRO autocommand, which may do nasty things and mess @@ -3505,10 +3505,10 @@ static int xdiff_out(int start_a, int count_a, int start_b, int count_b, void *p { diffout_T *dout = (diffout_T *)priv; GA_APPEND(diffhunk_T, &(dout->dout_ga), ((diffhunk_T){ - .lnum_orig = (linenr_T)start_a + 1, + .lnum_orig = (linenr_T)start_a + 1, .count_orig = count_a, - .lnum_new = (linenr_T)start_b + 1, - .count_new = count_b, + .lnum_new = (linenr_T)start_b + 1, + .count_new = count_b, })); return 0; } diff --git a/src/nvim/diff.h b/src/nvim/diff.h index 1f64465336..eda0fac5cb 100644 --- a/src/nvim/diff.h +++ b/src/nvim/diff.h @@ -8,11 +8,11 @@ #include "nvim/pos.h" // Value set from 'diffopt'. -EXTERN int diff_context INIT(= 6); // context for folds -EXTERN int diff_foldcolumn INIT(= 2); // 'foldcolumn' for diff mode -EXTERN bool diff_need_scrollbind INIT(= false); +EXTERN int diff_context INIT( = 6); // context for folds +EXTERN int diff_foldcolumn INIT( = 2); // 'foldcolumn' for diff mode +EXTERN bool diff_need_scrollbind INIT( = false); -EXTERN bool need_diff_redraw INIT(= false); // need to call diff_redraw() +EXTERN bool need_diff_redraw INIT( = false); // need to call diff_redraw() #ifdef INCLUDE_GENERATED_DECLARATIONS # include "diff.h.generated.h" diff --git a/src/nvim/drawline.c b/src/nvim/drawline.c index 81b9d97dfc..3d63d2c24c 100644 --- a/src/nvim/drawline.c +++ b/src/nvim/drawline.c @@ -1171,14 +1171,14 @@ int win_line(win_T *wp, linenr_T lnum, int startrow, int endrow, bool number_onl int left_curline_col = 0; int right_curline_col = 0; - int match_conc = 0; ///< cchar for match functions - bool on_last_col = false; - int syntax_flags = 0; - int syntax_seqnr = 0; - int prev_syntax_id = 0; - int conceal_attr = win_hl_attr(wp, HLF_CONCEAL); - bool is_concealing = false; - int did_wcol = false; + int match_conc = 0; ///< cchar for match functions + bool on_last_col = false; + int syntax_flags = 0; + int syntax_seqnr = 0; + int prev_syntax_id = 0; + int conceal_attr = win_hl_attr(wp, HLF_CONCEAL); + bool is_concealing = false; + int did_wcol = false; int old_boguscols = 0; #define VCOL_HLC (wlv.vcol - wlv.vcol_off) #define FIX_FOR_BOGUSCOLS \ diff --git a/src/nvim/drawline.h b/src/nvim/drawline.h index f35b15c474..8345596e6f 100644 --- a/src/nvim/drawline.h +++ b/src/nvim/drawline.h @@ -20,9 +20,9 @@ typedef struct { int win_row; int win_col; } WinExtmark; -EXTERN kvec_t(WinExtmark) win_extmark_arr INIT(= KV_INITIAL_VALUE); +EXTERN kvec_t(WinExtmark) win_extmark_arr INIT( = KV_INITIAL_VALUE); -EXTERN bool conceal_cursor_used INIT(= false); +EXTERN bool conceal_cursor_used INIT( = false); // Spell checking variables passed from win_update() to win_line(). typedef struct { diff --git a/src/nvim/drawscreen.h b/src/nvim/drawscreen.h index 7fab7ebacf..f3044e693a 100644 --- a/src/nvim/drawscreen.h +++ b/src/nvim/drawscreen.h @@ -21,9 +21,9 @@ enum { /// While redrawing the screen this flag is set. It means the screen size /// ('lines' and 'rows') must not be changed. -EXTERN bool updating_screen INIT(= 0); +EXTERN bool updating_screen INIT( = 0); -EXTERN match_T screen_search_hl INIT(= { 0 }); // used for 'hlsearch' highlight matching +EXTERN match_T screen_search_hl INIT( = { 0 }); // used for 'hlsearch' highlight matching #define W_ENDCOL(wp) ((wp)->w_wincol + (wp)->w_width) #define W_ENDROW(wp) ((wp)->w_winrow + (wp)->w_height) diff --git a/src/nvim/eval.h b/src/nvim/eval.h index aee5fb11ca..837a64fc81 100644 --- a/src/nvim/eval.h +++ b/src/nvim/eval.h @@ -277,7 +277,7 @@ enum { }; /// Passed to an eval() function to enable evaluation. -EXTERN evalarg_T EVALARG_EVALUATE INIT(= { EVAL_EVALUATE, NULL, NULL, NULL }); +EXTERN evalarg_T EVALARG_EVALUATE INIT( = { EVAL_EVALUATE, NULL, NULL, NULL }); #ifdef INCLUDE_GENERATED_DECLARATIONS # include "eval.h.generated.h" diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c index 8e5bf68be1..4759b4ebe3 100644 --- a/src/nvim/eval/funcs.c +++ b/src/nvim/eval/funcs.c @@ -2502,7 +2502,7 @@ static void f_getcwd(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) [kCdScopeTabpage] = 0, // Number of tab to look at. }; - char *cwd = NULL; // Current working directory to print + char *cwd = NULL; // Current working directory to print char *from = NULL; // The original string to copy tabpage_T *tp = curtab; // The tabpage to look at. @@ -3281,7 +3281,7 @@ static void f_haslocaldir(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) [kCdScopeTabpage] = 0, // Number of tab to look at. }; - tabpage_T *tp = curtab; // The tabpage to look at. + tabpage_T *tp = curtab; // The tabpage to look at. win_T *win = curwin; // The window to look at. rettv->v_type = VAR_NUMBER; @@ -5258,7 +5258,7 @@ static void f_prompt_setinterrupt(typval_T *argvars, typval_T *rettv, EvalFuncDa } callback_free(&buf->b_prompt_interrupt); - buf->b_prompt_interrupt= interrupt_callback; + buf->b_prompt_interrupt = interrupt_callback; } /// "prompt_getprompt({buffer})" function @@ -5589,9 +5589,9 @@ static void read_file_or_blob(typval_T *argvars, typval_T *rettv, bool always_bl char buf[(IOSIZE/256) * 256]; // rounded to avoid odd + 1 int io_size = sizeof(buf); char *prev = NULL; // previously read bytes, if any - ptrdiff_t prevlen = 0; // length of data in prev + ptrdiff_t prevlen = 0; // length of data in prev ptrdiff_t prevsize = 0; // size of prev buffer - int64_t maxline = MAXLNUM; + int64_t maxline = MAXLNUM; off_T offset = 0; off_T size = -1; @@ -5651,7 +5651,7 @@ static void read_file_or_blob(typval_T *argvars, typval_T *rettv, bool always_bl p < buf + readlen || (readlen <= 0 && (prevlen > 0 || binary)); p++) { if (readlen <= 0 || *p == '\n') { - char *s = NULL; + char *s = NULL; size_t len = (size_t)(p - start); // Finished a line. Remove CRs before NL. @@ -5754,7 +5754,7 @@ static void read_file_or_blob(typval_T *argvars, typval_T *rettv, bool always_bl prevsize = p - start; } else { ptrdiff_t grow50pc = (prevsize * 3) / 2; - ptrdiff_t growmin = (p - start) * 2 + prevlen; + ptrdiff_t growmin = (p - start) * 2 + prevlen; prevsize = grow50pc > growmin ? grow50pc : growmin; } prev = xrealloc(prev, (size_t)prevsize); diff --git a/src/nvim/eval/typval.c b/src/nvim/eval/typval.c index 9fca4adcf7..badb948584 100644 --- a/src/nvim/eval/typval.c +++ b/src/nvim/eval/typval.c @@ -3964,13 +3964,13 @@ bool tv_check_str_or_nr(const typval_T *const tv) #define FUNC_ERROR "E703: Using a Funcref as a Number" static const char *const num_errors[] = { - [VAR_PARTIAL]= N_(FUNC_ERROR), - [VAR_FUNC]= N_(FUNC_ERROR), - [VAR_LIST]= N_("E745: Using a List as a Number"), - [VAR_DICT]= N_("E728: Using a Dictionary as a Number"), - [VAR_FLOAT]= N_("E805: Using a Float as a Number"), - [VAR_BLOB]= N_("E974: Using a Blob as a Number"), - [VAR_UNKNOWN]= N_("E685: using an invalid value as a Number"), + [VAR_PARTIAL] = N_(FUNC_ERROR), + [VAR_FUNC] = N_(FUNC_ERROR), + [VAR_LIST] = N_("E745: Using a List as a Number"), + [VAR_DICT] = N_("E728: Using a Dictionary as a Number"), + [VAR_FLOAT] = N_("E805: Using a Float as a Number"), + [VAR_BLOB] = N_("E974: Using a Blob as a Number"), + [VAR_UNKNOWN] = N_("E685: using an invalid value as a Number"), }; #undef FUNC_ERROR @@ -4009,12 +4009,12 @@ bool tv_check_num(const typval_T *const tv) #define FUNC_ERROR "E729: Using a Funcref as a String" static const char *const str_errors[] = { - [VAR_PARTIAL]= N_(FUNC_ERROR), - [VAR_FUNC]= N_(FUNC_ERROR), - [VAR_LIST]= N_("E730: Using a List as a String"), - [VAR_DICT]= N_("E731: Using a Dictionary as a String"), - [VAR_BLOB]= N_("E976: Using a Blob as a String"), - [VAR_UNKNOWN]= e_using_invalid_value_as_string, + [VAR_PARTIAL] = N_(FUNC_ERROR), + [VAR_FUNC] = N_(FUNC_ERROR), + [VAR_LIST] = N_("E730: Using a List as a String"), + [VAR_DICT] = N_("E731: Using a Dictionary as a String"), + [VAR_BLOB] = N_("E976: Using a Blob as a String"), + [VAR_UNKNOWN] = e_using_invalid_value_as_string, }; #undef FUNC_ERROR diff --git a/src/nvim/eval/typval.h b/src/nvim/eval/typval.h index 0b42a473cf..7a168ba183 100644 --- a/src/nvim/eval/typval.h +++ b/src/nvim/eval/typval.h @@ -485,8 +485,8 @@ static inline bool tv_is_func(const typval_T tv) #ifdef UNIT_TESTING // Do not use enum constants, see commit message. -EXTERN const size_t kTVCstring INIT(= TV_CSTRING); -EXTERN const size_t kTVTranslate INIT(= TV_TRANSLATE); +EXTERN const size_t kTVCstring INIT( = TV_CSTRING); +EXTERN const size_t kTVTranslate INIT( = TV_TRANSLATE); #endif #ifdef INCLUDE_GENERATED_DECLARATIONS diff --git a/src/nvim/event/socket.c b/src/nvim/event/socket.c index 10756015ad..52a3c81449 100644 --- a/src/nvim/event/socket.c +++ b/src/nvim/event/socket.c @@ -224,7 +224,7 @@ bool socket_connect(Loop *loop, Stream *stream, bool is_tcp, const char *address const struct addrinfo hints = { .ai_family = AF_UNSPEC, .ai_socktype = SOCK_STREAM, - .ai_flags = AI_NUMERICSERV }; + .ai_flags = AI_NUMERICSERV }; int retval = uv_getaddrinfo(&loop->uv, &addr_req, NULL, addr, host_end + 1, &hints); if (retval != 0) { diff --git a/src/nvim/ex_cmds.c b/src/nvim/ex_cmds.c index 5ec4353e1d..fa10dd0805 100644 --- a/src/nvim/ex_cmds.c +++ b/src/nvim/ex_cmds.c @@ -3341,7 +3341,7 @@ static int do_sub(exarg_T *eap, const proftime_T timeout, const int cmdpreview_n int which_pat; char *cmd = eap->arg; linenr_T first_line = 0; // first changed line - linenr_T last_line= 0; // below last changed line AFTER the change + linenr_T last_line = 0; // below last changed line AFTER the change linenr_T old_line_count = curbuf->b_ml.ml_line_count; char *sub_firstline; // allocated copy of first sub line bool endcolumn = false; // cursor in last column when done @@ -3601,7 +3601,7 @@ static int do_sub(exarg_T *eap, const proftime_T timeout, const int cmdpreview_n while (true) { SubResult current_match = { .start = { 0, 0 }, - .end = { 0, 0 }, + .end = { 0, 0 }, .pre_match = 0, }; // lnum is where the match start, but maybe not the pattern match, @@ -3905,7 +3905,7 @@ static int do_sub(exarg_T *eap, const proftime_T timeout, const int cmdpreview_n if (current_match.end.lnum == 0) { current_match.end.lnum = sub_firstlnum + (linenr_T)nmatch - 1; } - current_match.end.col = regmatch.endpos[0].col; + current_match.end.col = regmatch.endpos[0].col; ADJUST_SUB_FIRSTLNUM(); lnum += (linenr_T)nmatch - 1; @@ -4636,7 +4636,7 @@ static int show_sub(exarg_T *eap, pos_T old_cusr, PreviewLines *preview_lines, i if (cmdpreview_buf) { lpos_T p_start = { 0, match.start.col }; // match starts here in preview - lpos_T p_end = { 0, match.end.col }; // ... and ends here + lpos_T p_end = { 0, match.end.col }; // ... and ends here // You Might Gonna Need It buf_ensure_loaded(cmdpreview_buf); diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 98da044bb4..772e0d0faf 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -159,19 +159,28 @@ static char dollar_command[2] = { '$', 0 }; static void save_dbg_stuff(struct dbg_stuff *dsp) { - dsp->trylevel = trylevel; trylevel = 0; - dsp->force_abort = force_abort; force_abort = false; - dsp->caught_stack = caught_stack; caught_stack = NULL; - dsp->vv_exception = v_exception(NULL); - dsp->vv_throwpoint = v_throwpoint(NULL); + dsp->trylevel = trylevel; + trylevel = 0; + dsp->force_abort = force_abort; + force_abort = false; + dsp->caught_stack = caught_stack; + caught_stack = NULL; + dsp->vv_exception = v_exception(NULL); + dsp->vv_throwpoint = v_throwpoint(NULL); // Necessary for debugging an inactive ":catch", ":finally", ":endtry". - dsp->did_emsg = did_emsg; did_emsg = false; - dsp->got_int = got_int; got_int = false; - dsp->did_throw = did_throw; did_throw = false; - dsp->need_rethrow = need_rethrow; need_rethrow = false; - dsp->check_cstack = check_cstack; check_cstack = false; - dsp->current_exception = current_exception; current_exception = NULL; + dsp->did_emsg = did_emsg; + did_emsg = false; + dsp->got_int = got_int; + got_int = false; + dsp->did_throw = did_throw; + did_throw = false; + dsp->need_rethrow = need_rethrow; + need_rethrow = false; + dsp->check_cstack = check_cstack; + check_cstack = false; + dsp->current_exception = current_exception; + current_exception = NULL; } static void restore_dbg_stuff(struct dbg_stuff *dsp) diff --git a/src/nvim/extmark.h b/src/nvim/extmark.h index 0b1f22aa84..c2103a71bf 100644 --- a/src/nvim/extmark.h +++ b/src/nvim/extmark.h @@ -14,7 +14,7 @@ #include "nvim/pos.h" #include "nvim/types.h" -EXTERN int extmark_splice_pending INIT(= 0); +EXTERN int extmark_splice_pending INIT( = 0); typedef struct { uint64_t ns_id; diff --git a/src/nvim/file_search.c b/src/nvim/file_search.c index 796d66f74c..796769d7ff 100644 --- a/src/nvim/file_search.c +++ b/src/nvim/file_search.c @@ -1119,12 +1119,12 @@ static ff_stack_T *ff_create_stack_element(char *fix_part, char *wc_part, int le { ff_stack_T *stack = xmalloc(sizeof(ff_stack_T)); - stack->ffs_prev = NULL; - stack->ffs_filearray = NULL; + stack->ffs_prev = NULL; + stack->ffs_filearray = NULL; stack->ffs_filearray_size = 0; - stack->ffs_filearray_cur = 0; - stack->ffs_stage = 0; - stack->ffs_level = level; + stack->ffs_filearray_cur = 0; + stack->ffs_stage = 0; + stack->ffs_level = level; stack->ffs_star_star_empty = star_star_empty; // the following saves NULL pointer checks in vim_findfile diff --git a/src/nvim/fold.c b/src/nvim/fold.c index 2e38f9ca3d..a3aabede5e 100644 --- a/src/nvim/fold.c +++ b/src/nvim/fold.c @@ -1783,7 +1783,7 @@ char *get_foldtext(win_T *wp, linenr_T lnum, linenr_T lnume, foldinfo_T foldinfo current_sctx = saved_sctx; } last_lnum = lnum; - last_wp = wp; + last_wp = wp; set_vim_var_string(VV_FOLDDASHES, NULL, -1); if (!did_emsg && save_did_emsg) { diff --git a/src/nvim/fold.h b/src/nvim/fold.h index ee7501f845..5a1ef836d3 100644 --- a/src/nvim/fold.h +++ b/src/nvim/fold.h @@ -10,7 +10,7 @@ #include "nvim/pos.h" #include "nvim/types.h" -EXTERN int disable_fold_update INIT(= 0); +EXTERN int disable_fold_update INIT( = 0); #ifdef INCLUDE_GENERATED_DECLARATIONS # include "fold.h.generated.h" diff --git a/src/nvim/func_attr.h b/src/nvim/func_attr.h index 9ac4ee28d6..9bb4500f43 100644 --- a/src/nvim/func_attr.h +++ b/src/nvim/func_attr.h @@ -125,7 +125,7 @@ # define REAL_FATTR_NONNULL_ALL __attribute__((nonnull)) # define REAL_FATTR_NONNULL_ARG(...) __attribute__((nonnull(__VA_ARGS__))) # define REAL_FATTR_NORETURN __attribute__((noreturn)) -# define REAL_FATTR_PRINTF(x, y) __attribute__((format (printf, x, y))) +# define REAL_FATTR_PRINTF(x, y) __attribute__((format(printf, x, y))) # if NVIM_HAS_ATTRIBUTE(returns_nonnull) # define REAL_FATTR_NONNULL_RET __attribute__((returns_nonnull)) diff --git a/src/nvim/globals.h b/src/nvim/globals.h index a719fedb22..4d0a6eb854 100644 --- a/src/nvim/globals.h +++ b/src/nvim/globals.h @@ -92,7 +92,7 @@ EXTERN struct nvim_stats_s { int64_t fsync; int64_t redraw; int16_t log_skip; // How many logs were tried and skipped before log_init. -} g_stats INIT(= { 0, 0, 0 }); +} g_stats INIT( = { 0, 0, 0 }); // Values for "starting". #define NO_SCREEN 2 // no screen updating yet @@ -106,8 +106,8 @@ EXTERN struct nvim_stats_s { // up). #define DFLT_COLS 80 // default value for 'columns' #define DFLT_ROWS 24 // default value for 'lines' -EXTERN int Rows INIT(= DFLT_ROWS); // nr of rows in the screen -EXTERN int Columns INIT(= DFLT_COLS); // nr of columns in the screen +EXTERN int Rows INIT( = DFLT_ROWS); // nr of rows in the screen +EXTERN int Columns INIT( = DFLT_COLS); // nr of columns in the screen // We use 64-bit file functions here, if available. E.g. ftello() returns // off_t instead of long, which helps if long is 32 bit and off_t is 64 bit. @@ -139,11 +139,11 @@ typedef off_t off_T; // When vgetc() is called, it sets mod_mask to the set of modifiers that are // held down based on the MOD_MASK_* symbols that are read first. -EXTERN int mod_mask INIT(= 0); // current key modifiers +EXTERN int mod_mask INIT( = 0); // current key modifiers // The value of "mod_mask" and the unmodified character before calling merge_modifiers(). -EXTERN int vgetc_mod_mask INIT(= 0); -EXTERN int vgetc_char INIT(= 0); +EXTERN int vgetc_mod_mask INIT( = 0); +EXTERN int vgetc_char INIT( = 0); // Cmdline_row is the row where the command line starts, just below the // last window. @@ -154,65 +154,65 @@ EXTERN int vgetc_char INIT(= 0); // update_screen(). EXTERN int cmdline_row; -EXTERN bool redraw_cmdline INIT(= false); // cmdline must be redrawn -EXTERN bool redraw_mode INIT(= false); // mode must be redrawn -EXTERN bool clear_cmdline INIT(= false); // cmdline must be cleared -EXTERN bool mode_displayed INIT(= false); // mode is being displayed -EXTERN int cmdline_star INIT(= false); // cmdline is encrypted -EXTERN bool redrawing_cmdline INIT(= false); // cmdline is being redrawn -EXTERN bool cmdline_was_last_drawn INIT(= false); // cmdline was last drawn +EXTERN bool redraw_cmdline INIT( = false); // cmdline must be redrawn +EXTERN bool redraw_mode INIT( = false); // mode must be redrawn +EXTERN bool clear_cmdline INIT( = false); // cmdline must be cleared +EXTERN bool mode_displayed INIT( = false); // mode is being displayed +EXTERN int cmdline_star INIT( = false); // cmdline is encrypted +EXTERN bool redrawing_cmdline INIT( = false); // cmdline is being redrawn +EXTERN bool cmdline_was_last_drawn INIT( = false); // cmdline was last drawn -EXTERN bool exec_from_reg INIT(= false); // executing register +EXTERN bool exec_from_reg INIT( = false); // executing register // When '$' is included in 'cpoptions' option set: // When a change command is given that deletes only part of a line, a dollar // is put at the end of the changed text. dollar_vcol is set to the virtual // column of this '$'. -1 is used to indicate no $ is being displayed. -EXTERN colnr_T dollar_vcol INIT(= -1); +EXTERN colnr_T dollar_vcol INIT( = -1); // Variables for Insert mode completion. -EXTERN char *edit_submode INIT(= NULL); // msg for CTRL-X submode -EXTERN char *edit_submode_pre INIT(= NULL); // prepended to edit_submode -EXTERN char *edit_submode_extra INIT(= NULL); // appended to edit_submode +EXTERN char *edit_submode INIT( = NULL); // msg for CTRL-X submode +EXTERN char *edit_submode_pre INIT( = NULL); // prepended to edit_submode +EXTERN char *edit_submode_extra INIT( = NULL); // appended to edit_submode EXTERN hlf_T edit_submode_highl; // highl. method for extra info // state for putting characters in the message area -EXTERN bool cmdmsg_rl INIT(= false); // cmdline is drawn right to left +EXTERN bool cmdmsg_rl INIT( = false); // cmdline is drawn right to left EXTERN int msg_col; EXTERN int msg_row; EXTERN int msg_scrolled; // Number of screen lines that windows have // scrolled because of printing messages. // when true don't set need_wait_return in msg_puts_attr() // when msg_scrolled is non-zero -EXTERN bool msg_scrolled_ign INIT(= false); +EXTERN bool msg_scrolled_ign INIT( = false); // Whether the screen is damaged due to scrolling. Sometimes msg_scrolled // is reset before the screen is redrawn, so we need to keep track of this. -EXTERN bool msg_did_scroll INIT(= false); - -EXTERN char *keep_msg INIT(= NULL); // msg to be shown after redraw -EXTERN int keep_msg_attr INIT(= 0); // highlight attr for keep_msg -EXTERN bool need_fileinfo INIT(= false); // do fileinfo() after redraw -EXTERN int msg_scroll INIT(= false); // msg_start() will scroll -EXTERN bool msg_didout INIT(= false); // msg_outstr() was used in line -EXTERN bool msg_didany INIT(= false); // msg_outstr() was used at all -EXTERN bool msg_nowait INIT(= false); // don't wait for this msg -EXTERN int emsg_off INIT(= 0); // don't display errors for now, - // unless 'debug' is set. -EXTERN bool info_message INIT(= false); // printing informative message -EXTERN bool msg_hist_off INIT(= false); // don't add messages to history -EXTERN bool need_clr_eos INIT(= false); // need to clear text before - // displaying a message. -EXTERN int emsg_skip INIT(= 0); // don't display errors for - // expression that is skipped -EXTERN bool emsg_severe INIT(= false); // use message of next of several - // emsg() calls for throw +EXTERN bool msg_did_scroll INIT( = false); + +EXTERN char *keep_msg INIT( = NULL); // msg to be shown after redraw +EXTERN int keep_msg_attr INIT( = 0); // highlight attr for keep_msg +EXTERN bool need_fileinfo INIT( = false); // do fileinfo() after redraw +EXTERN int msg_scroll INIT( = false); // msg_start() will scroll +EXTERN bool msg_didout INIT( = false); // msg_outstr() was used in line +EXTERN bool msg_didany INIT( = false); // msg_outstr() was used at all +EXTERN bool msg_nowait INIT( = false); // don't wait for this msg +EXTERN int emsg_off INIT( = 0); // don't display errors for now, + // unless 'debug' is set. +EXTERN bool info_message INIT( = false); // printing informative message +EXTERN bool msg_hist_off INIT( = false); // don't add messages to history +EXTERN bool need_clr_eos INIT( = false); // need to clear text before + // displaying a message. +EXTERN int emsg_skip INIT( = 0); // don't display errors for + // expression that is skipped +EXTERN bool emsg_severe INIT( = false); // use message of next of several + // emsg() calls for throw // used by assert_fails() -EXTERN char *emsg_assert_fails_msg INIT(= NULL); -EXTERN long emsg_assert_fails_lnum INIT(= 0); -EXTERN char *emsg_assert_fails_context INIT(= NULL); +EXTERN char *emsg_assert_fails_msg INIT( = NULL); +EXTERN long emsg_assert_fails_lnum INIT( = 0); +EXTERN char *emsg_assert_fails_context INIT( = NULL); -EXTERN bool did_endif INIT(= false); // just had ":endif" +EXTERN bool did_endif INIT( = false); // just had ":endif" EXTERN dict_T vimvardict; // Dictionary with v: variables EXTERN dict_T globvardict; // Dictionary with g: variables /// g: value @@ -223,39 +223,39 @@ EXTERN bool called_vim_beep; // set if vim_beep() is called EXTERN bool did_emsg_syntax; // did_emsg set because of a // syntax error EXTERN int called_emsg; // always incremented by emsg() -EXTERN int ex_exitval INIT(= 0); // exit value for ex mode -EXTERN bool emsg_on_display INIT(= false); // there is an error message -EXTERN bool rc_did_emsg INIT(= false); // vim_regcomp() called emsg() +EXTERN int ex_exitval INIT( = 0); // exit value for ex mode +EXTERN bool emsg_on_display INIT( = false); // there is an error message +EXTERN bool rc_did_emsg INIT( = false); // vim_regcomp() called emsg() -EXTERN int no_wait_return INIT(= 0); // don't wait for return for now -EXTERN bool need_wait_return INIT(= false); // need to wait for return later -EXTERN bool did_wait_return INIT(= false); // wait_return() was used and - // nothing written since then -EXTERN bool need_maketitle INIT(= true); // call maketitle() soon +EXTERN int no_wait_return INIT( = 0); // don't wait for return for now +EXTERN bool need_wait_return INIT( = false); // need to wait for return later +EXTERN bool did_wait_return INIT( = false); // wait_return() was used and + // nothing written since then +EXTERN bool need_maketitle INIT( = true); // call maketitle() soon -EXTERN bool quit_more INIT(= false); // 'q' hit at "--more--" msg -EXTERN int vgetc_busy INIT(= 0); // when inside vgetc() then > 0 +EXTERN bool quit_more INIT( = false); // 'q' hit at "--more--" msg +EXTERN int vgetc_busy INIT( = 0); // when inside vgetc() then > 0 -EXTERN bool didset_vim INIT(= false); // did set $VIM ourselves -EXTERN bool didset_vimruntime INIT(= false); // idem for $VIMRUNTIME +EXTERN bool didset_vim INIT( = false); // did set $VIM ourselves +EXTERN bool didset_vimruntime INIT( = false); // idem for $VIMRUNTIME /// Lines left before a "more" message. Ex mode needs to be able to reset this /// after you type something. -EXTERN int lines_left INIT(= -1); // lines left for listing -EXTERN bool msg_no_more INIT(= false); // don't use more prompt, truncate - // messages +EXTERN int lines_left INIT( = -1); // lines left for listing +EXTERN bool msg_no_more INIT( = false); // don't use more prompt, truncate + // messages -EXTERN int ex_nesting_level INIT(= 0); // nesting level -EXTERN int debug_break_level INIT(= -1); // break below this level -EXTERN bool debug_did_msg INIT(= false); // did "debug mode" message -EXTERN int debug_tick INIT(= 0); // breakpoint change count -EXTERN int debug_backtrace_level INIT(= 0); // breakpoint backtrace level +EXTERN int ex_nesting_level INIT( = 0); // nesting level +EXTERN int debug_break_level INIT( = -1); // break below this level +EXTERN bool debug_did_msg INIT( = false); // did "debug mode" message +EXTERN int debug_tick INIT( = 0); // breakpoint change count +EXTERN int debug_backtrace_level INIT( = 0); // breakpoint backtrace level // Values for "do_profiling". #define PROF_NONE 0 ///< profiling not started #define PROF_YES 1 ///< profiling busy #define PROF_PAUSED 2 ///< profiling paused -EXTERN int do_profiling INIT(= PROF_NONE); ///< PROF_ values +EXTERN int do_profiling INIT( = PROF_NONE); ///< PROF_ values /// Exception currently being thrown. Used to pass an exception to a different /// cstack. Also used for discarding an exception before it is caught or made @@ -264,19 +264,19 @@ EXTERN except_T *current_exception; /// An exception is being thrown. Reset when the exception is caught or as /// long as it is pending in a finally clause. -EXTERN bool did_throw INIT(= false); +EXTERN bool did_throw INIT( = false); /// Set when a throw that cannot be handled in do_cmdline() must be propagated /// to the cstack of the previously called do_cmdline(). -EXTERN bool need_rethrow INIT(= false); +EXTERN bool need_rethrow INIT( = false); /// 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(). -EXTERN bool check_cstack INIT(= false); +EXTERN bool check_cstack INIT( = false); /// Number of nested try conditionals (across function calls and ":source" /// commands). -EXTERN int trylevel INIT(= 0); +EXTERN int trylevel INIT( = 0); /// When "force_abort" is true, always skip commands after an error message, /// even after the outermost ":endif", ":endwhile" or ":endfor" or for a @@ -284,7 +284,7 @@ EXTERN int trylevel INIT(= 0); /// non-zero (and ":silent!" was not used) or an exception is being thrown at /// the time an error is detected. It is set to false when "trylevel" gets /// zero again and there was no error or interrupt or throw. -EXTERN bool force_abort INIT(= false); +EXTERN bool force_abort INIT( = false); /// "msg_list" points to a variable in the stack of do_cmdline() which keeps /// the list of arguments of several emsg() calls, one of which is to be @@ -294,19 +294,19 @@ EXTERN bool force_abort INIT(= false); /// same as the "msg" field of that element, but can be identical to the "msg" /// field of a later list element, when the "emsg_severe" flag was set when the /// emsg() call was made. -EXTERN msglist_T **msg_list INIT(= NULL); +EXTERN msglist_T **msg_list INIT( = NULL); /// When set, don't convert an error to an exception. Used when displaying the /// interrupt message or reporting an exception that is still uncaught at the /// top level (which has already been discarded then). Also used for the error /// message when no exception can be thrown. -EXTERN bool suppress_errthrow INIT(= false); +EXTERN bool suppress_errthrow INIT( = false); /// The stack of all caught and not finished exceptions. The exception on the /// top of the stack is the one got by evaluation of v:exception. The complete /// stack of all caught and pending exceptions is embedded in the various /// cstacks; the pending exceptions, however, are not on the caught stack. -EXTERN except_T *caught_stack INIT(= NULL); +EXTERN except_T *caught_stack INIT( = NULL); /// /// Garbage collection can only take place when we are sure there are no Lists @@ -316,9 +316,9 @@ EXTERN except_T *caught_stack INIT(= NULL); /// we do garbage collection before waiting for a char at the toplevel. /// "garbage_collect_at_exit" indicates garbagecollect(1) was called. /// -EXTERN bool may_garbage_collect INIT(= false); -EXTERN bool want_garbage_collect INIT(= false); -EXTERN bool garbage_collect_at_exit INIT(= false); +EXTERN bool may_garbage_collect INIT( = false); +EXTERN bool want_garbage_collect INIT( = false); +EXTERN bool garbage_collect_at_exit INIT( = false); // Special values for current_SID. #define SID_MODELINE (-1) // when using a modeline @@ -333,11 +333,11 @@ EXTERN bool garbage_collect_at_exit INIT(= false); #define SID_STR (-10) // for sourcing a string with no script item // Script CTX being sourced or was sourced to define the current function. -EXTERN sctx_T current_sctx INIT(= { 0, 0, 0 }); +EXTERN sctx_T current_sctx INIT( = { 0, 0, 0 }); // ID of the current channel making a client API call -EXTERN uint64_t current_channel_id INIT(= 0); +EXTERN uint64_t current_channel_id INIT( = 0); -EXTERN bool did_source_packages INIT(= false); +EXTERN bool did_source_packages INIT( = false); // Scope information for the code that indirectly triggered the current // provider function call @@ -349,73 +349,73 @@ EXTERN struct caller_scope { int autocmd_bufnr; void *funccalp; } provider_caller_scope; -EXTERN int provider_call_nesting INIT(= 0); +EXTERN int provider_call_nesting INIT( = 0); -EXTERN int t_colors INIT(= 256); // int value of T_CCO +EXTERN int t_colors INIT( = 256); // int value of T_CCO // Flags to indicate an additional string for highlight name completion. -EXTERN int include_none INIT(= 0); // when 1 include "None" -EXTERN int include_default INIT(= 0); // when 1 include "default" -EXTERN int include_link INIT(= 0); // when 2 include "link" and "clear" +EXTERN int include_none INIT( = 0); // when 1 include "None" +EXTERN int include_default INIT( = 0); // when 1 include "default" +EXTERN int include_link INIT( = 0); // when 2 include "link" and "clear" // When highlight_match is true, highlight a match, starting at the cursor // position. Search_match_lines is the number of lines after the match (0 for // a match within one line), search_match_endcol the column number of the // character just after the match in the last line. -EXTERN bool highlight_match INIT(= false); // show search match pos +EXTERN bool highlight_match INIT( = false); // show search match pos EXTERN linenr_T search_match_lines; // lines of matched string EXTERN colnr_T search_match_endcol; // col nr of match end -EXTERN linenr_T search_first_line INIT(= 0); // for :{FIRST},{last}s/pat -EXTERN linenr_T search_last_line INIT(= MAXLNUM); // for :{first},{LAST}s/pat +EXTERN linenr_T search_first_line INIT( = 0); // for :{FIRST},{last}s/pat +EXTERN linenr_T search_last_line INIT( = MAXLNUM); // for :{first},{LAST}s/pat -EXTERN bool no_smartcase INIT(= false); // don't use 'smartcase' once +EXTERN bool no_smartcase INIT( = false); // don't use 'smartcase' once -EXTERN bool need_check_timestamps INIT(= false); // need to check file - // timestamps asap -EXTERN bool did_check_timestamps INIT(= false); // did check timestamps - // recently -EXTERN int no_check_timestamps INIT(= 0); // Don't check timestamps +EXTERN bool need_check_timestamps INIT( = false); // need to check file + // timestamps