]> granicus.if.org Git - vim/commitdiff
updated for version 7.3.181 v7.3.181
authorBram Moolenaar <Bram@vim.org>
Tue, 10 May 2011 12:22:16 +0000 (14:22 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 10 May 2011 12:22:16 +0000 (14:22 +0200)
Problem:    When repeating the insert of CTRL-V or a digraph the display may
            not be updated correctly.
Solution:   Only call edit_unputchar() after edit_putchar(). (Lech Lorens)

src/edit.c
src/version.c

index ad146c86cb8d17721558d3d051fb629669fd9346..a43c0a2c16b5c7b0719a70ad6e8d0c8c4b00534c 100644 (file)
@@ -1553,12 +1553,16 @@ ins_redraw(ready)
 ins_ctrl_v()
 {
     int                c;
+    int                did_putchar = FALSE;
 
     /* may need to redraw when no more chars available now */
     ins_redraw(FALSE);
 
     if (redrawing() && !char_avail())
+    {
        edit_putchar('^', TRUE);
+       did_putchar = TRUE;
+    }
     AppendToRedobuff((char_u *)CTRL_V_STR);    /* CTRL-V */
 
 #ifdef FEAT_CMDL_INFO
@@ -1566,8 +1570,10 @@ ins_ctrl_v()
 #endif
 
     c = get_literal();
-    edit_unputchar();  /* when line fits in 'columns' the '^' is at the start
-                         of the next line and will not be redrawn */
+    if (did_putchar)
+       /* when the line fits in 'columns' the '^' is at the start of the next
+        * line and will not removed by the redraw */
+       edit_unputchar();
 #ifdef FEAT_CMDL_INFO
     clear_showcmd();
 #endif
@@ -9637,6 +9643,7 @@ ins_digraph()
 {
     int            c;
     int            cc;
+    int            did_putchar = FALSE;
 
     pc_status = PC_STATUS_UNSET;
     if (redrawing() && !char_avail())
@@ -9645,6 +9652,7 @@ ins_digraph()
        ins_redraw(FALSE);
 
        edit_putchar('?', TRUE);
+       did_putchar = TRUE;
 #ifdef FEAT_CMDL_INFO
        add_to_showcmd_c(Ctrl_K);
 #endif
@@ -9661,8 +9669,10 @@ ins_digraph()
     c = plain_vgetc();
     --no_mapping;
     --allow_keys;
-    edit_unputchar();  /* when line fits in 'columns' the '?' is at the start
-                         of the next line and will not be redrawn */
+    if (did_putchar)
+       /* when the line fits in 'columns' the '?' is at the start of the next
+        * line and will not be removed by the redraw */
+       edit_unputchar();
 
     if (IS_SPECIAL(c) || mod_mask)         /* special key */
     {
@@ -9674,6 +9684,7 @@ ins_digraph()
     }
     if (c != ESC)
     {
+       did_putchar = FALSE;
        if (redrawing() && !char_avail())
        {
            /* may need to redraw when no more chars available now */
@@ -9681,11 +9692,9 @@ ins_digraph()
 
            if (char2cells(c) == 1)
            {
-               /* first remove the '?', otherwise it's restored when typing
-                * an ESC next */
-               edit_unputchar();
                ins_redraw(FALSE);
                edit_putchar(c, TRUE);
+               did_putchar = TRUE;
            }
 #ifdef FEAT_CMDL_INFO
            add_to_showcmd_c(c);
@@ -9696,8 +9705,10 @@ ins_digraph()
        cc = plain_vgetc();
        --no_mapping;
        --allow_keys;
-       edit_unputchar();  /* when line fits in 'columns' the '?' is at the
-                             start of the next line and will not be redrawn */
+       if (did_putchar)
+           /* when the line fits in 'columns' the '?' is at the start of the
+            * next line and will not be removed by a redraw */
+           edit_unputchar();
        if (cc != ESC)
        {
            AppendToRedobuff((char_u *)CTRL_V_STR);
index 6a21278b1a12d730b03810486173fb17ea9252f7..3b4cb835947834f4e83aa3f58bdb913e609ee092 100644 (file)
@@ -714,6 +714,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    181,
 /**/
     180,
 /**/