diff options
author | Felipe Oliveira Carvalho <felipekde@gmail.com> | 2014-12-13 10:56:17 -0300 |
---|---|---|
committer | Felipe Oliveira Carvalho <felipekde@gmail.com> | 2014-12-13 23:36:11 -0300 |
commit | 0bc40e660c0a74776ace86ad5e393755523c3803 (patch) | |
tree | 94fd08577b5eed003b6f7eb3a7bcafcac7f20a66 /src/nvim/syntax.c | |
parent | 77135447e09903b45d1482da45869946212f7904 (diff) | |
download | rneovim-0bc40e660c0a74776ace86ad5e393755523c3803.tar.gz rneovim-0bc40e660c0a74776ace86ad5e393755523c3803.tar.bz2 rneovim-0bc40e660c0a74776ace86ad5e393755523c3803.zip |
Simple refatorings that didn't fit the pattern of the last commit
Diffstat (limited to 'src/nvim/syntax.c')
-rw-r--r-- | src/nvim/syntax.c | 46 |
1 files changed, 22 insertions, 24 deletions
diff --git a/src/nvim/syntax.c b/src/nvim/syntax.c index c8a1a1a7c7..b7a485598b 100644 --- a/src/nvim/syntax.c +++ b/src/nvim/syntax.c @@ -1513,33 +1513,31 @@ syn_finish_line ( stateitem_T *cur_si; colnr_T prev_current_col; - if (!current_finished) { - while (!current_finished) { - (void)syn_current_attr(syncing, FALSE, NULL, FALSE); + 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) { /* - * When syncing, and found some item, need to check the item. + * Check for match with sync item. */ - if (syncing && current_state.ga_len) { - /* - * Check for match with sync item. - */ - 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; - if (syn_getcurline()[current_col] != NUL) - ++current_col; - check_state_ends(); - current_col = prev_current_col; - } - ++current_col; + 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; + if (syn_getcurline()[current_col] != NUL) + ++current_col; + check_state_ends(); + current_col = prev_current_col; } + ++current_col; } return FALSE; } |