]> granicus.if.org Git - vim/commitdiff
updated for version 7.1-219 v7.1.219
authorBram Moolenaar <Bram@vim.org>
Sat, 12 Jan 2008 15:47:10 +0000 (15:47 +0000)
committerBram Moolenaar <Bram@vim.org>
Sat, 12 Jan 2008 15:47:10 +0000 (15:47 +0000)
runtime/doc/eval.txt
src/eval.c
src/hardcopy.c
src/proto/syntax.pro
src/screen.c
src/spell.c
src/syntax.c
src/version.c

index 97439fa98ccb7dd30001f818d6d280d568499d3f..5a665c36e98f5dfaa89b2f39d71a5d8c64d7cd92 100644 (file)
@@ -1,4 +1,4 @@
-*eval.txt*      For Vim version 7.1.  Last change: 2008 Jan 10
+*eval.txt*      For Vim version 7.1.  Last change: 2008 Jan 11
 
 
                  VIM REFERENCE MANUAL    by Bram Moolenaar
@@ -4967,10 +4967,6 @@ synstack({lnum}, {col})                                  *synstack()*
                Return a |List|, which is the stack of syntax items at the
                position {lnum} and {col} in the current window.  Each item in
                the List is an ID like what |synID()| returns.
-               The stack is the situation in between the character at "col"
-               and the next character.  Note that a region of only one
-               character will not show up, it only exists inside that
-               character, not in between characters.
                The first item in the List is the outer region, following are
                items contained in that one.  The last one is what |synID()|
                returns, unless not the whole item is highlighted or it is a
index ade6f5a1cea1117bc5ce5b3b004161a89d3460bd..41e816ef00fc2920e0120887c718f2d15fa4f0f6 100644 (file)
@@ -15725,7 +15725,7 @@ f_synID(argvars, rettv)
 
     if (!transerr && lnum >= 1 && lnum <= curbuf->b_ml.ml_line_count
            && col >= 0 && col < (long)STRLEN(ml_get(lnum)))
-       id = syn_get_id(curwin, lnum, (colnr_T)col, trans, NULL);
+       id = syn_get_id(curwin, lnum, (colnr_T)col, trans, NULL, FALSE);
 #endif
 
     rettv->vval.v_number = id;
@@ -15874,7 +15874,7 @@ f_synstack(argvars, rettv)
            && col >= 0 && col < (long)STRLEN(ml_get(lnum))
            && rettv_list_alloc(rettv) != FAIL)
     {
-       (void)syn_get_id(curwin, lnum, (colnr_T)col, FALSE, NULL);
+       (void)syn_get_id(curwin, lnum, (colnr_T)col, FALSE, NULL, TRUE);
        for (i = 0; ; ++i)
        {
            id = syn_get_stack_item(i);
index 9e5383e4216ef33800c7781064f1ca58e60fb40b..7cc256ff3a6fef03e271c3305e78de60737b5952 100644 (file)
@@ -876,7 +876,7 @@ hardcopy_line(psettings, page_line, ppos)
         */
        if (psettings->do_syntax)
        {
-           id = syn_get_id(curwin, ppos->file_line, col, 1, NULL);
+           id = syn_get_id(curwin, ppos->file_line, col, 1, NULL, FALSE);
            if (id > 0)
                id = syn_get_final_id(id);
            else
index b6f008f6fe75eee544c14136a642bd5c597e485d..c27769198b032e9a2b6cdaef9b8e682897071d11 100644 (file)
@@ -4,7 +4,7 @@ void syn_stack_free_all __ARGS((buf_T *buf));
 void syn_stack_apply_changes __ARGS((buf_T *buf));
 void syntax_end_parsing __ARGS((linenr_T lnum));
 int syntax_check_changed __ARGS((linenr_T lnum));
-int get_syntax_attr __ARGS((colnr_T col, int *can_spell));
+int get_syntax_attr __ARGS((colnr_T col, int *can_spell, int keep_state));
 void syntax_clear __ARGS((buf_T *buf));
 void ex_syntax __ARGS((exarg_T *eap));
 int syntax_present __ARGS((buf_T *buf));
@@ -12,7 +12,7 @@ void reset_expand_highlight __ARGS((void));
 void set_context_in_echohl_cmd __ARGS((expand_T *xp, char_u *arg));
 void set_context_in_syntax_cmd __ARGS((expand_T *xp, char_u *arg));
 char_u *get_syntax_name __ARGS((expand_T *xp, int idx));
-int syn_get_id __ARGS((win_T *wp, long lnum, colnr_T col, int trans, int *spellp));
+int syn_get_id __ARGS((win_T *wp, long lnum, colnr_T col, int trans, int *spellp, int keep_state));
 int syn_get_stack_item __ARGS((int i));
 int syn_get_foldlevel __ARGS((win_T *wp, long lnum));
 void init_highlight __ARGS((int both, int reset));
index f85bd082543f0e0b3cdb183a8774a8f2d088be15..d39414687ed3c98ec54601df73ecc104366d9942 100644 (file)
@@ -3885,7 +3885,7 @@ win_line(wp, lnum, startrow, endrow, nochange)
 # ifdef FEAT_SPELL
                                               has_spell ? &can_spell :
 # endif
-                                              NULL);
+                                              NULL, FALSE);
 
                    if (did_emsg)
                    {
index ce887f7493ed1e431158600883dd40eaca649e2f..8e9c6cb39d2bba20a3d8bb430c1a2ad34283cde9 100644 (file)
@@ -2146,7 +2146,7 @@ spell_move_to(wp, dir, allwords, curline, attrp)
                        {
                            col = (int)(p - buf);
                            (void)syn_get_id(wp, lnum, (colnr_T)col,
-                                                      FALSE, &can_spell);
+                                                   FALSE, &can_spell, FALSE);
                            if (!can_spell)
                                attr = HLF_COUNT;
                        }
index e824682a58fb138fe20dec879f045d050bd5fa62..bc9f0324c6a5777307d5541046f36088425afb4d 100644 (file)
@@ -378,7 +378,7 @@ static void invalidate_current_state __ARGS((void));
 static int syn_stack_equal __ARGS((synstate_T *sp));
 static void validate_current_state __ARGS((void));
 static int syn_finish_line __ARGS((int syncing));
-static int syn_current_attr __ARGS((int syncing, int displaying, int *can_spell));
+static int syn_current_attr __ARGS((int syncing, int displaying, int *can_spell, int keep_state));
 static int did_match_already __ARGS((int idx, garray_T *gap));
 static stateitem_T *push_next_match __ARGS((stateitem_T *cur_si));
 static void check_state_ends __ARGS((void));
@@ -1691,7 +1691,7 @@ syn_finish_line(syncing)
     {
        while (!current_finished)
        {
-           (void)syn_current_attr(syncing, FALSE, NULL);
+           (void)syn_current_attr(syncing, FALSE, NULL, FALSE);
            /*
             * When syncing, and found some item, need to check the item.
             */
@@ -1731,9 +1731,10 @@ syn_finish_line(syncing)
  * done.
  */
     int
-get_syntax_attr(col, can_spell)
+get_syntax_attr(col, can_spell, keep_state)
     colnr_T    col;
     int                *can_spell;
+    int                keep_state;     /* keep state of char at "col" */
 {
     int            attr = 0;
 
@@ -1768,7 +1769,8 @@ get_syntax_attr(col, can_spell)
      */
     while (current_col <= col)
     {
-       attr = syn_current_attr(FALSE, TRUE, can_spell);
+       attr = syn_current_attr(FALSE, TRUE, can_spell,
+                                    current_col == col ? keep_state : FALSE);
        ++current_col;
     }
 
@@ -1779,10 +1781,11 @@ get_syntax_attr(col, can_spell)
  * Get syntax attributes for current_lnum, current_col.
  */
     static int
-syn_current_attr(syncing, displaying, can_spell)
+syn_current_attr(syncing, displaying, can_spell, keep_state)
     int                syncing;                /* When 1: called for syncing */
     int                displaying;             /* result will be displayed */
     int                *can_spell;             /* return: do spell checking */
+    int                keep_state;             /* keep syntax stack afterwards */
 {
     int                syn_id;
     lpos_T     endpos;         /* was: char_u *endp; */
@@ -2298,7 +2301,7 @@ syn_current_attr(syncing, displaying, can_spell)
         * may be for an empty match and a containing item might end in the
         * current column.
         */
-       if (!syncing)
+       if (!syncing && !keep_state)
        {
            check_state_ends();
            if (current_state.ga_len > 0
@@ -6086,12 +6089,13 @@ get_syntax_name(xp, idx)
  * Function called for expression evaluation: get syntax ID at file position.
  */
     int
-syn_get_id(wp, lnum, col, trans, spellp)
+syn_get_id(wp, lnum, col, trans, spellp, keep_state)
     win_T      *wp;
     long       lnum;
     colnr_T    col;
-    int                trans;      /* remove transparancy */
-    int                *spellp;    /* return: can do spell checking */
+    int                trans;       /* remove transparancy */
+    int                *spellp;     /* return: can do spell checking */
+    int                keep_state;  /* keep state of char at "col" */
 {
     /* When the position is not after the current position and in the same
      * line of the same buffer, need to restart parsing. */
@@ -6100,7 +6104,7 @@ syn_get_id(wp, lnum, col, trans, spellp)
            || col < current_col)
        syntax_start(wp, lnum);
 
-    (void)get_syntax_attr(col, spellp);
+    (void)get_syntax_attr(col, spellp, keep_state);
 
     return (trans ? current_trans_id : current_id);
 }
@@ -6115,8 +6119,14 @@ syn_get_id(wp, lnum, col, trans, spellp)
 syn_get_stack_item(i)
     int i;
 {
-    if (i >= current_state.ga_len )
+    if (i >= current_state.ga_len)
+    {
+       /* Need to invalidate the state, because we didn't properly finish it
+        * for the last character, "keep_state" was TRUE. */
+       invalidate_current_state();
+       current_col = MAXCOL;
        return -1;
+    }
     return CUR_STATE(i).si_id;
 }
 #endif
index bf6941ebb3b4e9634b8bfd291edefdbb750ce590..fc44754dbae834eda5899676b8f6ba0884d0a991 100644 (file)
@@ -666,6 +666,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    219,
 /**/
     218,
 /**/