diff options
author | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-07-30 15:29:19 -0400 |
---|---|---|
committer | Jan Edmund Lazo <janedmundlazo@hotmail.com> | 2018-07-30 15:29:22 -0400 |
commit | 8f647cf03c7fe1f74edce5a98cf8d460a8aa331a (patch) | |
tree | 7430f1ef05a30299404a250b697ff019e95e6be5 /src/nvim/syntax.c | |
parent | eafcfb2fb5c044737d896f8132bb9714f3662b97 (diff) | |
download | rneovim-8f647cf03c7fe1f74edce5a98cf8d460a8aa331a.tar.gz rneovim-8f647cf03c7fe1f74edce5a98cf8d460a8aa331a.tar.bz2 rneovim-8f647cf03c7fe1f74edce5a98cf8d460a8aa331a.zip |
syntax: add const to syn_finish_line() params,vars
Diffstat (limited to 'src/nvim/syntax.c')
-rw-r--r-- | src/nvim/syntax.c | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index 056422d9fc..0e40677f8b 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -1526,31 +1526,26 @@ int syntax_check_changed(linenr_T lnum) */ static bool syn_finish_line( - bool syncing // called for syncing + const bool syncing // called for syncing ) { - stateitem_T *cur_si; - colnr_T prev_current_col; - while (!current_finished) { (void)syn_current_attr(syncing, false, NULL, false); // When syncing, and found some item, need to check the item. if (syncing && current_state.ga_len) { - /* - * Check for match with sync item. - */ - cur_si = &CUR_STATE(current_state.ga_len - 1); + // Check for match with sync item. + const stateitem_T *const cur_si = &CUR_STATE(current_state.ga_len - 1); if (cur_si->si_idx >= 0 && (SYN_ITEMS(syn_block)[cur_si->si_idx].sp_flags & (HL_SYNC_HERE|HL_SYNC_THERE))) { return true; } - /* syn_current_attr() will have skipped the check for an item - * that ends here, need to do that now. Be careful not to go - * past the NUL. */ - prev_current_col = current_col; + // syn_current_attr() will have skipped the check for an item + // that ends here, need to do that now. Be careful not to go + // past the NUL. + const colnr_T prev_current_col = current_col; if (syn_getcurline()[current_col] != NUL) { current_col++; } |