summaryrefslogtreecommitdiffstats
path: root/source/ap/vim/patches/7.3.181
blob: 3151d445501ddd7c0618ee5cfee5c59da50c6676 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
To: vim_dev@googlegroups.com
Subject: Patch 7.3.181
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 7.3.181
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)
Files:	    src/edit.c


*** ../vim-7.3.180/src/edit.c	2010-11-10 17:11:29.000000000 +0100
--- src/edit.c	2011-05-10 14:16:41.000000000 +0200
***************
*** 1553,1564 ****
--- 1553,1568 ----
  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,1573 ****
  #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 */
  #ifdef FEAT_CMDL_INFO
      clear_showcmd();
  #endif
--- 1570,1579 ----
  #endif
  
      c = get_literal();
!     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,9642 ****
--- 9643,9649 ----
  {
      int	    c;
      int	    cc;
+     int	    did_putchar = FALSE;
  
      pc_status = PC_STATUS_UNSET;
      if (redrawing() && !char_avail())
***************
*** 9645,9650 ****
--- 9652,9658 ----
  	ins_redraw(FALSE);
  
  	edit_putchar('?', TRUE);
+ 	did_putchar = TRUE;
  #ifdef FEAT_CMDL_INFO
  	add_to_showcmd_c(Ctrl_K);
  #endif
***************
*** 9661,9668 ****
      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 (IS_SPECIAL(c) || mod_mask)	    /* special key */
      {
--- 9669,9678 ----
      c = plain_vgetc();
      --no_mapping;
      --allow_keys;
!     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,9679 ****
--- 9684,9690 ----
      }
      if (c != ESC)
      {
+ 	did_putchar = FALSE;
  	if (redrawing() && !char_avail())
  	{
  	    /* may need to redraw when no more chars available now */
***************
*** 9681,9691 ****
  
  	    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);
  	    }
  #ifdef FEAT_CMDL_INFO
  	    add_to_showcmd_c(c);
--- 9692,9700 ----
  
  	    if (char2cells(c) == 1)
  	    {
  		ins_redraw(FALSE);
  		edit_putchar(c, TRUE);
+ 		did_putchar = TRUE;
  	    }
  #ifdef FEAT_CMDL_INFO
  	    add_to_showcmd_c(c);
***************
*** 9696,9703 ****
  	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 (cc != ESC)
  	{
  	    AppendToRedobuff((char_u *)CTRL_V_STR);
--- 9705,9714 ----
  	cc = plain_vgetc();
  	--no_mapping;
  	--allow_keys;
! 	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);
*** ../vim-7.3.180/src/version.c	2011-05-10 13:38:23.000000000 +0200
--- src/version.c	2011-05-10 14:20:40.000000000 +0200
***************
*** 716,717 ****
--- 716,719 ----
  {   /* Add new patch number below this line */
+ /**/
+     181,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
74. Your most erotic dreams are about cybersex

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///