This commit is contained in:
Jan Edmund Lazo
2019-04-14 23:41:43 -04:00
parent 07a182c6b5
commit bbc32fc831
4 changed files with 36 additions and 33 deletions

View File

@@ -388,25 +388,25 @@ typedef struct {
* a window may have its own instance. * a window may have its own instance.
*/ */
typedef struct { typedef struct {
hashtab_T b_keywtab; /* syntax keywords hash table */ hashtab_T b_keywtab; // syntax keywords hash table
hashtab_T b_keywtab_ic; /* idem, ignore case */ hashtab_T b_keywtab_ic; // idem, ignore case
int b_syn_error; /* TRUE when error occurred in HL */ int b_syn_error; // TRUE when error occurred in HL
bool b_syn_slow; // true when 'redrawtime' reached bool b_syn_slow; // true when 'redrawtime' reached
int b_syn_ic; /* ignore case for :syn cmds */ int b_syn_ic; // ignore case for :syn cmds
int b_syn_spell; /* SYNSPL_ values */ int b_syn_spell; // SYNSPL_ values
garray_T b_syn_patterns; /* table for syntax patterns */ garray_T b_syn_patterns; // table for syntax patterns
garray_T b_syn_clusters; /* table for syntax clusters */ garray_T b_syn_clusters; // table for syntax clusters
int b_spell_cluster_id; /* @Spell cluster ID or 0 */ int b_spell_cluster_id; // @Spell cluster ID or 0
int b_nospell_cluster_id; /* @NoSpell cluster ID or 0 */ int b_nospell_cluster_id; // @NoSpell cluster ID or 0
int b_syn_containedin; /* TRUE when there is an item with a int b_syn_containedin; // TRUE when there is an item with a
"containedin" argument */ // "containedin" argument
int b_syn_sync_flags; /* flags about how to sync */ int b_syn_sync_flags; // flags about how to sync
short b_syn_sync_id; /* group to sync on */ int16_t b_syn_sync_id; // group to sync on
long b_syn_sync_minlines; /* minimal sync lines offset */ long b_syn_sync_minlines; // minimal sync lines offset
long b_syn_sync_maxlines; /* maximal sync lines offset */ long b_syn_sync_maxlines; // maximal sync lines offset
long b_syn_sync_linebreaks; /* offset for multi-line pattern */ long b_syn_sync_linebreaks; // offset for multi-line pattern
char_u *b_syn_linecont_pat; /* line continuation pattern */ char_u *b_syn_linecont_pat; // line continuation pattern
regprog_T *b_syn_linecont_prog; /* line continuation program */ regprog_T *b_syn_linecont_prog; // line continuation program
syn_time_T b_syn_linecont_time; syn_time_T b_syn_linecont_time;
int b_syn_linecont_ic; /* ignore-case flag for above */ int b_syn_linecont_ic; /* ignore-case flag for above */
int b_syn_topgrp; /* for ":syntax include" */ int b_syn_topgrp; /* for ":syntax include" */

View File

@@ -7224,7 +7224,8 @@ static void report_re_switch(char_u *pat)
/// @param nl /// @param nl
/// ///
/// @return TRUE if there is a match, FALSE if not. /// @return TRUE if there is a match, FALSE if not.
static int vim_regexec_string(regmatch_T *rmp, char_u *line, colnr_T col, bool nl) static int vim_regexec_string(regmatch_T *rmp, char_u *line, colnr_T col,
bool nl)
{ {
regexec_T rex_save; regexec_T rex_save;
bool rex_in_use_save = rex_in_use; bool rex_in_use_save = rex_in_use;
@@ -7273,7 +7274,7 @@ static int vim_regexec_string(regmatch_T *rmp, char_u *line, colnr_T col, bool n
int vim_regexec_prog(regprog_T **prog, bool ignore_case, char_u *line, int vim_regexec_prog(regprog_T **prog, bool ignore_case, char_u *line,
colnr_T col) colnr_T col)
{ {
regmatch_T regmatch = {.regprog = *prog, .rm_ic = ignore_case}; regmatch_T regmatch = { .regprog = *prog, .rm_ic = ignore_case };
int r = vim_regexec_string(&regmatch, line, col, false); int r = vim_regexec_string(&regmatch, line, col, false);
*prog = regmatch.regprog; *prog = regmatch.regprog;
return r; return r;

View File

@@ -1364,7 +1364,8 @@ static void win_update(win_T *wp)
/* /*
* Display one line. * Display one line.
*/ */
row = win_line(wp, lnum, srow, wp->w_grid.Rows, mod_top == 0, false, &syntax_tm); row = win_line(wp, lnum, srow, wp->w_grid.Rows, mod_top == 0, false,
&syntax_tm);
wp->w_lines[idx].wl_folded = FALSE; wp->w_lines[idx].wl_folded = FALSE;
wp->w_lines[idx].wl_lastlnum = lnum; wp->w_lines[idx].wl_lastlnum = lnum;
@@ -1395,7 +1396,8 @@ static void win_update(win_T *wp)
if (fold_count != 0) { if (fold_count != 0) {
fold_line(wp, fold_count, &win_foldinfo, lnum, row); fold_line(wp, fold_count, &win_foldinfo, lnum, row);
} else { } else {
(void)win_line(wp, lnum, srow, wp->w_grid.Rows, true, true, &syntax_tm); (void)win_line(wp, lnum, srow, wp->w_grid.Rows, true, true,
&syntax_tm);
} }
} }
@@ -2544,7 +2546,7 @@ win_line (
} }
wp->w_cursor = pos; wp->w_cursor = pos;
/* Need to restart syntax highlighting for this line. */ // Need to restart syntax highlighting for this line.
if (has_syntax) { if (has_syntax) {
syntax_start(wp, lnum, syntax_tm); syntax_start(wp, lnum, syntax_tm);
} }

View File

@@ -356,16 +356,16 @@ static reg_extmatch_T *next_match_extmatch = NULL;
* The current state (within the line) of the recognition engine. * The current state (within the line) of the recognition engine.
* When current_state.ga_itemsize is 0 the current state is invalid. * When current_state.ga_itemsize is 0 the current state is invalid.
*/ */
static win_T *syn_win; /* current window for highlighting */ static win_T *syn_win; // current window for highlighting
static buf_T *syn_buf; /* current buffer for highlighting */ static buf_T *syn_buf; // current buffer for highlighting
static synblock_T *syn_block; /* current buffer for highlighting */ static synblock_T *syn_block; // current buffer for highlighting
static proftime_T *syn_tm; static proftime_T *syn_tm;
static linenr_T current_lnum = 0; /* lnum of current state */ static linenr_T current_lnum = 0; // lnum of current state
static colnr_T current_col = 0; /* column of current state */ static colnr_T current_col = 0; // column of current state
static int current_state_stored = 0; /* TRUE if stored current state static int current_state_stored = 0; // TRUE if stored current state
* after setting current_finished */ // after setting current_finished
static int current_finished = 0; /* current line has been finished */ static int current_finished = 0; // current line has been finished
static garray_T current_state /* current stack of state_items */ static garray_T current_state // current stack of state_items
= GA_EMPTY_INIT_VALUE; = GA_EMPTY_INIT_VALUE;
static int16_t *current_next_list = NULL; // when non-zero, nextgroup list static int16_t *current_next_list = NULL; // when non-zero, nextgroup list
static int current_next_flags = 0; // flags for current_next_list static int current_next_flags = 0; // flags for current_next_list
@@ -5764,7 +5764,7 @@ int syn_get_foldlevel(win_T *wp, long lnum)
{ {
int level = 0; int level = 0;
/* Return quickly when there are no fold items at all. */ // Return quickly when there are no fold items at all.
if (wp->w_s->b_syn_folditems != 0 if (wp->w_s->b_syn_folditems != 0
&& !wp->w_s->b_syn_error && !wp->w_s->b_syn_error
&& !wp->w_s->b_syn_slow) { && !wp->w_s->b_syn_slow) {