@@ -1782,36 +1782,33 @@ syn_finish_line(
17821782 stateitem_T * cur_si ;
17831783 colnr_T prev_current_col ;
17841784
1785- if (!current_finished )
1785+ while (!current_finished )
17861786 {
1787- while (!current_finished )
1787+ (void )syn_current_attr (syncing , FALSE, NULL , FALSE);
1788+ /*
1789+ * When syncing, and found some item, need to check the item.
1790+ */
1791+ if (syncing && current_state .ga_len )
17881792 {
1789- (void )syn_current_attr (syncing , FALSE, NULL , FALSE);
17901793 /*
1791- * When syncing, and found some item, need to check the item.
1794+ * Check for match with sync item.
17921795 */
1793- if (syncing && current_state .ga_len )
1794- {
1795- /*
1796- * Check for match with sync item.
1797- */
1798- cur_si = & CUR_STATE (current_state .ga_len - 1 );
1799- if (cur_si -> si_idx >= 0
1800- && (SYN_ITEMS (syn_block )[cur_si -> si_idx ].sp_flags
1801- & (HL_SYNC_HERE |HL_SYNC_THERE )))
1802- return TRUE;
1803-
1804- /* syn_current_attr() will have skipped the check for an item
1805- * that ends here, need to do that now. Be careful not to go
1806- * past the NUL. */
1807- prev_current_col = current_col ;
1808- if (syn_getcurline ()[current_col ] != NUL )
1809- ++ current_col ;
1810- check_state_ends ();
1811- current_col = prev_current_col ;
1812- }
1813- ++ current_col ;
1796+ cur_si = & CUR_STATE (current_state .ga_len - 1 );
1797+ if (cur_si -> si_idx >= 0
1798+ && (SYN_ITEMS (syn_block )[cur_si -> si_idx ].sp_flags
1799+ & (HL_SYNC_HERE |HL_SYNC_THERE )))
1800+ return TRUE;
1801+
1802+ /* syn_current_attr() will have skipped the check for an item
1803+ * that ends here, need to do that now. Be careful not to go
1804+ * past the NUL. */
1805+ prev_current_col = current_col ;
1806+ if (syn_getcurline ()[current_col ] != NUL )
1807+ ++ current_col ;
1808+ check_state_ends ();
1809+ current_col = prev_current_col ;
18141810 }
1811+ ++ current_col ;
18151812 }
18161813 return FALSE;
18171814}
@@ -3333,7 +3330,7 @@ syn_regexec(
33333330/*
33343331 * Check one position in a line for a matching keyword.
33353332 * The caller must check if a keyword can start at startcol.
3336- * Return it's ID if found, 0 otherwise.
3333+ * Return its ID if found, 0 otherwise.
33373334 */
33383335 static int
33393336check_keyword_id (
@@ -5495,7 +5492,7 @@ syn_combine_list(short **clstr1, short **clstr2, int list_op)
54955492}
54965493
54975494/*
5498- * Lookup a syntax cluster name and return it's ID.
5495+ * Lookup a syntax cluster name and return its ID.
54995496 * If it is not found, 0 is returned.
55005497 */
55015498 static int
@@ -5535,7 +5532,7 @@ syn_scl_namen2id(char_u *linep, int len)
55355532}
55365533
55375534/*
5538- * Find syntax cluster name in the table and return it's ID.
5535+ * Find syntax cluster name in the table and return its ID.
55395536 * The argument is a pointer to the name and the length of the name.
55405537 * If it doesn't exist yet, a new entry is created.
55415538 * Return 0 for failure.
@@ -5559,7 +5556,7 @@ syn_check_cluster(char_u *pp, int len)
55595556}
55605557
55615558/*
5562- * Add new syntax cluster and return it's ID.
5559+ * Add new syntax cluster and return its ID.
55635560 * "name" must be an allocated string, it will be consumed.
55645561 * Return 0 for failure.
55655562 */
@@ -7752,7 +7749,7 @@ do_highlight(
77527749 break ;
77537750 }
77547751
7755- /* Use the _16 table to check if its a valid color name. */
7752+ /* Use the _16 table to check if it's a valid color name. */
77567753 color = color_numbers_16 [i ];
77577754 if (color >= 0 )
77587755 {
@@ -9346,7 +9343,7 @@ set_hl_attr(
93469343}
93479344
93489345/*
9349- * Lookup a highlight group name and return it's ID.
9346+ * Lookup a highlight group name and return its ID.
93509347 * If it is not found, 0 is returned.
93519348 */
93529349 int
@@ -9411,7 +9408,7 @@ syn_namen2id(char_u *linep, int len)
94119408}
94129409
94139410/*
9414- * Find highlight group name in the table and return it's ID.
9411+ * Find highlight group name in the table and return its ID.
94159412 * The argument is a pointer to the name and the length of the name.
94169413 * If it doesn't exist yet, a new entry is created.
94179414 * Return 0 for failure.
@@ -9435,7 +9432,7 @@ syn_check_group(char_u *pp, int len)
94359432}
94369433
94379434/*
9438- * Add new highlight group and return it's ID.
9435+ * Add new highlight group and return its ID.
94399436 * "name" must be an allocated string, it will be consumed.
94409437 * Return 0 for failure.
94419438 */
0 commit comments