summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-03-18 21:37:28 +0100
committerBram Moolenaar <Bram@vim.org>2017-03-18 21:37:28 +0100
commitaab93b12cb54fbe5efe9e8f6fde1c46802a3031e (patch)
treeabe08b9d6c1696173fd926a6a7fb77b96cb8ec5e
parent15e737f768542fcc516296b5c158e14cc7ba7feb (diff)
downloadvim-git-8.0.0481.tar.gz
patch 8.0.0481: unnecessary if statementv8.0.0481
Problem: Unnecessary if statement. Solution: Remove the statement. Fix "it's" vs "its" mistakes. (Dominique Pelle, closes #1568)
-rw-r--r--src/syntax.c63
-rw-r--r--src/version.c2
2 files changed, 32 insertions, 33 deletions
diff --git a/src/syntax.c b/src/syntax.c
index 027f2a6ae..a8942e797 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -1782,36 +1782,33 @@ syn_finish_line(
stateitem_T *cur_si;
colnr_T prev_current_col;
- if (!current_finished)
+ while (!current_finished)
{
- 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)
{
- (void)syn_current_attr(syncing, FALSE, NULL, FALSE);
/*
- * 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;
}
@@ -3333,7 +3330,7 @@ syn_regexec(
/*
* Check one position in a line for a matching keyword.
* The caller must check if a keyword can start at startcol.
- * Return it's ID if found, 0 otherwise.
+ * Return its ID if found, 0 otherwise.
*/
static int
check_keyword_id(
@@ -5495,7 +5492,7 @@ syn_combine_list(short **clstr1, short **clstr2, int list_op)
}
/*
- * Lookup a syntax cluster name and return it's ID.
+ * Lookup a syntax cluster name and return its ID.
* If it is not found, 0 is returned.
*/
static int
@@ -5535,7 +5532,7 @@ syn_scl_namen2id(char_u *linep, int len)
}
/*
- * Find syntax cluster name in the table and return it's ID.
+ * Find syntax cluster name in the table and return its ID.
* The argument is a pointer to the name and the length of the name.
* If it doesn't exist yet, a new entry is created.
* Return 0 for failure.
@@ -5559,7 +5556,7 @@ syn_check_cluster(char_u *pp, int len)
}
/*
- * Add new syntax cluster and return it's ID.
+ * Add new syntax cluster and return its ID.
* "name" must be an allocated string, it will be consumed.
* Return 0 for failure.
*/
@@ -7752,7 +7749,7 @@ do_highlight(
break;
}
- /* Use the _16 table to check if its a valid color name. */
+ /* Use the _16 table to check if it's a valid color name. */
color = color_numbers_16[i];
if (color >= 0)
{
@@ -9346,7 +9343,7 @@ set_hl_attr(
}
/*
- * Lookup a highlight group name and return it's ID.
+ * Lookup a highlight group name and return its ID.
* If it is not found, 0 is returned.
*/
int
@@ -9411,7 +9408,7 @@ syn_namen2id(char_u *linep, int len)
}
/*
- * Find highlight group name in the table and return it's ID.
+ * Find highlight group name in the table and return its ID.
* The argument is a pointer to the name and the length of the name.
* If it doesn't exist yet, a new entry is created.
* Return 0 for failure.
@@ -9435,7 +9432,7 @@ syn_check_group(char_u *pp, int len)
}
/*
- * Add new highlight group and return it's ID.
+ * Add new highlight group and return its ID.
* "name" must be an allocated string, it will be consumed.
* Return 0 for failure.
*/
diff --git a/src/version.c b/src/version.c
index 69b4990d2..007a1e673 100644
--- a/src/version.c
+++ b/src/version.c
@@ -765,6 +765,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 481,
+/**/
480,
/**/
479,