]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.426 v7.3.426
authorBram Moolenaar <Bram@vim.org>
Sat, 4 Feb 2012 22:35:00 +0000 (23:35 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 4 Feb 2012 22:35:00 +0000 (23:35 +0100)
Problem:    With '$' in 'cpoptions' the $ is not displayed in the first
            column.
Solution:   Use -1 instead of 0 as a special value. (Hideki Eiraku and
            Hirohito Higashi)

src/edit.c
src/globals.h
src/move.c
src/screen.c
src/search.c
src/version.c

index 9a0abf94f48bea9f499aee0efb8872a7748452fc..6ac6142c6109d506dfac8b2b74735bb4746830e7 100644 (file)
@@ -1763,9 +1763,9 @@ display_dollar(col)
     static void
 undisplay_dollar()
 {
-    if (dollar_vcol)
+    if (dollar_vcol >= 0)
     {
-       dollar_vcol = 0;
+       dollar_vcol = -1;
        redrawWinline(curwin->w_cursor.lnum, FALSE);
     }
 }
@@ -5441,7 +5441,7 @@ ins_complete(c)
                                compl_curr_match->cp_number);
                edit_submode_extra = match_ref;
                edit_submode_highl = HLF_R;
-               if (dollar_vcol)
+               if (dollar_vcol >= 0)
                    curs_columns(FALSE);
            }
        }
@@ -8961,7 +8961,7 @@ ins_bs(c, mode, inserted_space_p)
      * We can emulate the vi behaviour by pretending there is a dollar
      * displayed even when there isn't.
      *  --pkv Sun Jan 19 01:56:40 EST 2003 */
-    if (vim_strchr(p_cpo, CPO_BACKSPACE) != NULL && dollar_vcol == 0)
+    if (vim_strchr(p_cpo, CPO_BACKSPACE) != NULL && dollar_vcol == -1)
        dollar_vcol = curwin->w_virtcol;
 
 #ifdef FEAT_FOLDING
index 2c7f257a2f810eb291330f1302f79d1414214892..13851923f1ea0c47115df3dd032b81bea3202c45 100644 (file)
@@ -113,9 +113,9 @@ EXTERN int      use_crypt_method INIT(= 0);
  * When '$' is included in 'cpoptions' option set:
  * When a change command is given that deletes only part of a line, a dollar
  * is put at the end of the changed text. dollar_vcol is set to the virtual
- * column of this '$'.
+ * column of this '$'.  -1 is used to indicate no $ is being displayed.
  */
-EXTERN colnr_T dollar_vcol INIT(= 0);
+EXTERN colnr_T dollar_vcol INIT(= -1);
 
 #ifdef FEAT_INS_EXPAND
 /*
index f922da8e4661d45e04e531750f4d4820e233eecb..ccbb4addc465ca94ff9afce30012790ab365a92b 100644 (file)
@@ -362,7 +362,7 @@ update_topline()
 #endif
            )
     {
-       dollar_vcol = 0;
+       dollar_vcol = -1;
        if (curwin->w_skipcol != 0)
        {
            curwin->w_skipcol = 0;
@@ -966,7 +966,7 @@ curs_columns(may_scroll)
 
     /* remove '$' from change command when cursor moves onto it */
     if (startcol > dollar_vcol)
-       dollar_vcol = 0;
+       dollar_vcol = -1;
 
     extra = curwin_col_off();
     curwin->w_wcol = curwin->w_virtcol + extra;
index ffbd1c34e5caf7719334d9c13a604a64ccd7b1a7..9bac8bce30a379656773361aa47a135e8c7478a3 100644 (file)
@@ -1637,11 +1637,11 @@ win_update(wp)
             * When at start of changed lines: May scroll following lines
             * up or down to minimize redrawing.
             * Don't do this when the change continues until the end.
-            * Don't scroll when dollar_vcol is non-zero, keep the "$".
+            * Don't scroll when dollar_vcol >= 0, keep the "$".
             */
            if (lnum == mod_top
                    && mod_bot != MAXLNUM
-                   && !(dollar_vcol != 0 && mod_bot == mod_top + 1))
+                   && !(dollar_vcol >= 0 && mod_bot == mod_top + 1))
            {
                int             old_rows = 0;
                int             new_rows = 0;
@@ -1868,12 +1868,12 @@ win_update(wp)
            if (row > wp->w_height)     /* past end of screen */
            {
                /* we may need the size of that too long line later on */
-               if (dollar_vcol == 0)
+               if (dollar_vcol == -1)
                    wp->w_lines[idx].wl_size = plines_win(wp, lnum, TRUE);
                ++idx;
                break;
            }
-           if (dollar_vcol == 0)
+           if (dollar_vcol == -1)
                wp->w_lines[idx].wl_size = row - srow;
            ++idx;
 #ifdef FEAT_FOLDING
@@ -1990,7 +1990,7 @@ win_update(wp)
            }
 #endif
        }
-       else if (dollar_vcol == 0)
+       else if (dollar_vcol == -1)
            wp->w_botline = lnum;
 
        /* make sure the rest of the screen is blank */
@@ -2005,7 +2005,7 @@ win_update(wp)
     wp->w_old_botfill = wp->w_botfill;
 #endif
 
-    if (dollar_vcol == 0)
+    if (dollar_vcol == -1)
     {
        /*
         * There is a trick with w_botline.  If we invalidate it on each
@@ -3564,7 +3564,7 @@ win_line(wp, lnum, startrow, endrow, nochange)
        }
 
        /* When still displaying '$' of change command, stop at cursor */
-       if (dollar_vcol != 0 && wp == curwin
+       if (dollar_vcol >= 0 && wp == curwin
                   && lnum == wp->w_cursor.lnum && vcol >= (long)wp->w_virtcol
 #ifdef FEAT_DIFF
                                   && filler_todo <= 0
index b29551dab6e6f57a3c9f0681cedf0c1165c405e6..59de988a71cafdbf13186a2f560634376304f1fc 100644 (file)
@@ -2501,8 +2501,8 @@ showmatch(c)
            save_siso = p_siso;
            /* Handle "$" in 'cpo': If the ')' is typed on top of the "$",
             * stop displaying the "$". */
-           if (dollar_vcol > 0 && dollar_vcol == curwin->w_virtcol)
-               dollar_vcol = 0;
+           if (dollar_vcol >= 0 && dollar_vcol == curwin->w_virtcol)
+               dollar_vcol = -1;
            ++curwin->w_virtcol;        /* do display ')' just before "$" */
            update_screen(VALID);       /* show the new char first */
 
index a63b67cd18e4a41aa43f6e881af37be4814f8c04..a55888f536978e2ff495fdf60b3fb64994cd27ab 100644 (file)
@@ -714,6 +714,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    426,
 /**/
     425,
 /**/