summaryrefslogtreecommitdiffstats
path: root/patches/source/vim/patches/7.4.143
blob: 909a9e9c28ea649617af78175d8ebbf0cfc728c0 (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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
To: vim_dev@googlegroups.com
Subject: Patch 7.4.143
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.4.143
Problem:    TextChangedI is not triggered.
Solution:   Reverse check for "ready". (lilydjwg)
Files:	    src/edit.c


*** ../vim-7.4.142/src/edit.c	2013-11-06 04:01:31.000000000 +0100
--- src/edit.c	2014-01-12 13:30:53.000000000 +0100
***************
*** 1556,1642 ****
      int		conceal_update_lines = FALSE;
  #endif
  
!     if (!char_avail())
!     {
  #if defined(FEAT_AUTOCMD) || defined(FEAT_CONCEAL)
! 	/* Trigger CursorMoved if the cursor moved.  Not when the popup menu is
! 	 * visible, the command might delete it. */
! 	if (ready && (
  # ifdef FEAT_AUTOCMD
! 		    has_cursormovedI()
  # endif
  # if defined(FEAT_AUTOCMD) && defined(FEAT_CONCEAL)
! 		    ||
  # endif
  # ifdef FEAT_CONCEAL
! 		    curwin->w_p_cole > 0
  # endif
! 		    )
! 	    && !equalpos(last_cursormoved, curwin->w_cursor)
  # ifdef FEAT_INS_EXPAND
! 	    && !pum_visible()
  # endif
! 	   )
! 	{
  # ifdef FEAT_SYN_HL
! 	    /* Need to update the screen first, to make sure syntax
! 	     * highlighting is correct after making a change (e.g., inserting
! 	     * a "(".  The autocommand may also require a redraw, so it's done
! 	     * again below, unfortunately. */
! 	    if (syntax_present(curwin) && must_redraw)
! 		update_screen(0);
  # endif
  # ifdef FEAT_AUTOCMD
! 	    if (has_cursormovedI())
! 		apply_autocmds(EVENT_CURSORMOVEDI, NULL, NULL, FALSE, curbuf);
  # endif
  # ifdef FEAT_CONCEAL
! 	    if (curwin->w_p_cole > 0)
! 	    {
! 		conceal_old_cursor_line = last_cursormoved.lnum;
! 		conceal_new_cursor_line = curwin->w_cursor.lnum;
! 		conceal_update_lines = TRUE;
! 	    }
! # endif
! 	    last_cursormoved = curwin->w_cursor;
  	}
  #endif
  #ifdef FEAT_AUTOCMD
! 	/* Trigger TextChangedI if b_changedtick differs. */
! 	if (!ready && has_textchangedI()
! 		&& last_changedtick != curbuf->b_changedtick
  # ifdef FEAT_INS_EXPAND
! 		&& !pum_visible()
  # endif
! 		)
! 	{
! 	    if (last_changedtick_buf == curbuf)
! 		apply_autocmds(EVENT_TEXTCHANGEDI, NULL, NULL, FALSE, curbuf);
! 	    last_changedtick_buf = curbuf;
! 	    last_changedtick = curbuf->b_changedtick;
! 	}
  #endif
! 	if (must_redraw)
! 	    update_screen(0);
! 	else if (clear_cmdline || redraw_cmdline)
! 	    showmode();		/* clear cmdline and show mode */
  # if defined(FEAT_CONCEAL)
! 	if ((conceal_update_lines
! 		&& (conceal_old_cursor_line != conceal_new_cursor_line
! 		    || conceal_cursor_line(curwin)))
! 		|| need_cursor_line_redraw)
! 	{
! 	    if (conceal_old_cursor_line != conceal_new_cursor_line)
! 		update_single_line(curwin, conceal_old_cursor_line);
! 	    update_single_line(curwin, conceal_new_cursor_line == 0
! 			   ? curwin->w_cursor.lnum : conceal_new_cursor_line);
! 	    curwin->w_valid &= ~VALID_CROW;
! 	}
! # endif
! 	showruler(FALSE);
! 	setcursor();
! 	emsg_on_display = FALSE;	/* may remove error message now */
      }
  }
  
  /*
--- 1556,1644 ----
      int		conceal_update_lines = FALSE;
  #endif
  
!     if (char_avail())
! 	return;
! 
  #if defined(FEAT_AUTOCMD) || defined(FEAT_CONCEAL)
!     /* Trigger CursorMoved if the cursor moved.  Not when the popup menu is
!      * visible, the command might delete it. */
!     if (ready && (
  # ifdef FEAT_AUTOCMD
! 		has_cursormovedI()
  # endif
  # if defined(FEAT_AUTOCMD) && defined(FEAT_CONCEAL)
! 		||
  # endif
  # ifdef FEAT_CONCEAL
! 		curwin->w_p_cole > 0
  # endif
! 		)
! 	&& !equalpos(last_cursormoved, curwin->w_cursor)
  # ifdef FEAT_INS_EXPAND
! 	&& !pum_visible()
  # endif
!        )
!     {
  # ifdef FEAT_SYN_HL
! 	/* Need to update the screen first, to make sure syntax
! 	 * highlighting is correct after making a change (e.g., inserting
! 	 * a "(".  The autocommand may also require a redraw, so it's done
! 	 * again below, unfortunately. */
! 	if (syntax_present(curwin) && must_redraw)
! 	    update_screen(0);
  # endif
  # ifdef FEAT_AUTOCMD
! 	if (has_cursormovedI())
! 	    apply_autocmds(EVENT_CURSORMOVEDI, NULL, NULL, FALSE, curbuf);
  # endif
  # ifdef FEAT_CONCEAL
! 	if (curwin->w_p_cole > 0)
! 	{
! 	    conceal_old_cursor_line = last_cursormoved.lnum;
! 	    conceal_new_cursor_line = curwin->w_cursor.lnum;
! 	    conceal_update_lines = TRUE;
  	}
+ # endif
+ 	last_cursormoved = curwin->w_cursor;
+     }
  #endif
+ 
  #ifdef FEAT_AUTOCMD
!     /* Trigger TextChangedI if b_changedtick differs. */
!     if (ready && has_textchangedI()
! 	    && last_changedtick != curbuf->b_changedtick
  # ifdef FEAT_INS_EXPAND
! 	    && !pum_visible()
  # endif
! 	    )
!     {
! 	if (last_changedtick_buf == curbuf)
! 	    apply_autocmds(EVENT_TEXTCHANGEDI, NULL, NULL, FALSE, curbuf);
! 	last_changedtick_buf = curbuf;
! 	last_changedtick = curbuf->b_changedtick;
!     }
  #endif
! 
!     if (must_redraw)
! 	update_screen(0);
!     else if (clear_cmdline || redraw_cmdline)
! 	showmode();		/* clear cmdline and show mode */
  # if defined(FEAT_CONCEAL)
!     if ((conceal_update_lines
! 	    && (conceal_old_cursor_line != conceal_new_cursor_line
! 		|| conceal_cursor_line(curwin)))
! 	    || need_cursor_line_redraw)
!     {
! 	if (conceal_old_cursor_line != conceal_new_cursor_line)
! 	    update_single_line(curwin, conceal_old_cursor_line);
! 	update_single_line(curwin, conceal_new_cursor_line == 0
! 		       ? curwin->w_cursor.lnum : conceal_new_cursor_line);
! 	curwin->w_valid &= ~VALID_CROW;
      }
+ # endif
+     showruler(FALSE);
+     setcursor();
+     emsg_on_display = FALSE;	/* may remove error message now */
  }
  
  /*
*** ../vim-7.4.142/src/version.c	2014-01-12 13:24:46.000000000 +0100
--- src/version.c	2014-01-14 12:15:50.000000000 +0100
***************
*** 740,741 ****
--- 740,743 ----
  {   /* Add new patch number below this line */
+ /**/
+     143,
  /**/

-- 
You are not really successful until someone claims he sat
beside you in school.

 /// 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    ///