summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2006-10-03 15:04:36 +0000
committerBram Moolenaar <Bram@vim.org>2006-10-03 15:04:36 +0000
commit7bd2cd8d19776a26fd692e40c095fcc379194e97 (patch)
treee072e9e4da32244eba9a410f0b4a2b7332165eac
parentd9b8733023e0946431abfb90c2d73fc0695756a3 (diff)
downloadvim-git-7bd2cd8d19776a26fd692e40c095fcc379194e97.tar.gz
updated for version 7.0-117v7.0.117
-rw-r--r--src/syntax.c32
-rw-r--r--src/version.c2
2 files changed, 27 insertions, 7 deletions
diff --git a/src/syntax.c b/src/syntax.c
index e6062411c..1b09e707b 100644
--- a/src/syntax.c
+++ b/src/syntax.c
@@ -977,6 +977,7 @@ syn_update_ends(startofline)
{
stateitem_T *cur_si;
int i;
+ int seen_keepend;
if (startofline)
{
@@ -1002,7 +1003,10 @@ syn_update_ends(startofline)
/*
* Need to update the end of a start/skip/end that continues from the
* previous line. And regions that have "keepend", because they may
- * influence contained items.
+ * influence contained items. If we've just removed "extend"
+ * (startofline == 0) then we should update ends of normal regions
+ * contained inside "keepend" because "extend" could have extended
+ * these "keepend" regions as well as contained normal regions.
* Then check for items ending in column 0.
*/
i = current_state.ga_len - 1;
@@ -1010,10 +1014,13 @@ syn_update_ends(startofline)
for ( ; i > keepend_level; --i)
if (CUR_STATE(i).si_flags & HL_EXTEND)
break;
+
+ seen_keepend = FALSE;
for ( ; i < current_state.ga_len; ++i)
{
cur_si = &CUR_STATE(i);
if ((cur_si->si_flags & HL_KEEPEND)
+ || (seen_keepend && !startofline)
|| (i == current_state.ga_len - 1 && startofline))
{
cur_si->si_h_startpos.col = 0; /* start highl. in col 0 */
@@ -1021,6 +1028,9 @@ syn_update_ends(startofline)
if (!(cur_si->si_flags & HL_MATCHCONT))
update_si_end(cur_si, (int)current_col, !startofline);
+
+ if (!startofline && (cur_si->si_flags & HL_KEEPEND))
+ seen_keepend = TRUE;
}
}
check_keepend();
@@ -2564,6 +2574,7 @@ check_keepend()
{
int i;
lpos_T maxpos;
+ lpos_T maxpos_h;
stateitem_T *sip;
/*
@@ -2583,23 +2594,30 @@ check_keepend()
break;
maxpos.lnum = 0;
+ maxpos_h.lnum = 0;
for ( ; i < current_state.ga_len; ++i)
{
sip = &CUR_STATE(i);
if (maxpos.lnum != 0)
{
limit_pos_zero(&sip->si_m_endpos, &maxpos);
- limit_pos_zero(&sip->si_h_endpos, &maxpos);
+ limit_pos_zero(&sip->si_h_endpos, &maxpos_h);
limit_pos_zero(&sip->si_eoe_pos, &maxpos);
sip->si_ends = TRUE;
}
- if (sip->si_ends
- && (sip->si_flags & HL_KEEPEND)
- && (maxpos.lnum == 0
+ if (sip->si_ends && (sip->si_flags & HL_KEEPEND))
+ {
+ if (maxpos.lnum == 0
|| maxpos.lnum > sip->si_m_endpos.lnum
|| (maxpos.lnum == sip->si_m_endpos.lnum
- && maxpos.col > sip->si_m_endpos.col)))
- maxpos = sip->si_m_endpos;
+ && maxpos.col > sip->si_m_endpos.col))
+ maxpos = sip->si_m_endpos;
+ if (maxpos_h.lnum == 0
+ || maxpos_h.lnum > sip->si_h_endpos.lnum
+ || (maxpos_h.lnum == sip->si_h_endpos.lnum
+ && maxpos_h.col > sip->si_h_endpos.col))
+ maxpos_h = sip->si_h_endpos;
+ }
}
}
diff --git a/src/version.c b/src/version.c
index 85dc9209c..2006cc197 100644
--- a/src/version.c
+++ b/src/version.c
@@ -667,6 +667,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 117,
+/**/
116,
/**/
115,