home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / 7.4 / 7.4.143 < prev    next >
Encoding:
Internet Message Format  |  2014-01-13  |  6.2 KB

  1. To: vim_dev@googlegroups.com
  2. Subject: Patch 7.4.143
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset=UTF-8
  7. Content-Transfer-Encoding: 8bit
  8. ------------
  9.  
  10. Patch 7.4.143
  11. Problem:    TextChangedI is not triggered.
  12. Solution:   Reverse check for "ready". (lilydjwg)
  13. Files:        src/edit.c
  14.  
  15.  
  16. *** ../vim-7.4.142/src/edit.c    2013-11-06 04:01:31.000000000 +0100
  17. --- src/edit.c    2014-01-12 13:30:53.000000000 +0100
  18. ***************
  19. *** 1556,1642 ****
  20.       int        conceal_update_lines = FALSE;
  21.   #endif
  22.   
  23. !     if (!char_avail())
  24. !     {
  25.   #if defined(FEAT_AUTOCMD) || defined(FEAT_CONCEAL)
  26. !     /* Trigger CursorMoved if the cursor moved.  Not when the popup menu is
  27. !      * visible, the command might delete it. */
  28. !     if (ready && (
  29.   # ifdef FEAT_AUTOCMD
  30. !             has_cursormovedI()
  31.   # endif
  32.   # if defined(FEAT_AUTOCMD) && defined(FEAT_CONCEAL)
  33. !             ||
  34.   # endif
  35.   # ifdef FEAT_CONCEAL
  36. !             curwin->w_p_cole > 0
  37.   # endif
  38. !             )
  39. !         && !equalpos(last_cursormoved, curwin->w_cursor)
  40.   # ifdef FEAT_INS_EXPAND
  41. !         && !pum_visible()
  42.   # endif
  43. !        )
  44. !     {
  45.   # ifdef FEAT_SYN_HL
  46. !         /* Need to update the screen first, to make sure syntax
  47. !          * highlighting is correct after making a change (e.g., inserting
  48. !          * a "(".  The autocommand may also require a redraw, so it's done
  49. !          * again below, unfortunately. */
  50. !         if (syntax_present(curwin) && must_redraw)
  51. !         update_screen(0);
  52.   # endif
  53.   # ifdef FEAT_AUTOCMD
  54. !         if (has_cursormovedI())
  55. !         apply_autocmds(EVENT_CURSORMOVEDI, NULL, NULL, FALSE, curbuf);
  56.   # endif
  57.   # ifdef FEAT_CONCEAL
  58. !         if (curwin->w_p_cole > 0)
  59. !         {
  60. !         conceal_old_cursor_line = last_cursormoved.lnum;
  61. !         conceal_new_cursor_line = curwin->w_cursor.lnum;
  62. !         conceal_update_lines = TRUE;
  63. !         }
  64. ! # endif
  65. !         last_cursormoved = curwin->w_cursor;
  66.       }
  67.   #endif
  68.   #ifdef FEAT_AUTOCMD
  69. !     /* Trigger TextChangedI if b_changedtick differs. */
  70. !     if (!ready && has_textchangedI()
  71. !         && last_changedtick != curbuf->b_changedtick
  72.   # ifdef FEAT_INS_EXPAND
  73. !         && !pum_visible()
  74.   # endif
  75. !         )
  76. !     {
  77. !         if (last_changedtick_buf == curbuf)
  78. !         apply_autocmds(EVENT_TEXTCHANGEDI, NULL, NULL, FALSE, curbuf);
  79. !         last_changedtick_buf = curbuf;
  80. !         last_changedtick = curbuf->b_changedtick;
  81. !     }
  82.   #endif
  83. !     if (must_redraw)
  84. !         update_screen(0);
  85. !     else if (clear_cmdline || redraw_cmdline)
  86. !         showmode();        /* clear cmdline and show mode */
  87.   # if defined(FEAT_CONCEAL)
  88. !     if ((conceal_update_lines
  89. !         && (conceal_old_cursor_line != conceal_new_cursor_line
  90. !             || conceal_cursor_line(curwin)))
  91. !         || need_cursor_line_redraw)
  92. !     {
  93. !         if (conceal_old_cursor_line != conceal_new_cursor_line)
  94. !         update_single_line(curwin, conceal_old_cursor_line);
  95. !         update_single_line(curwin, conceal_new_cursor_line == 0
  96. !                ? curwin->w_cursor.lnum : conceal_new_cursor_line);
  97. !         curwin->w_valid &= ~VALID_CROW;
  98. !     }
  99. ! # endif
  100. !     showruler(FALSE);
  101. !     setcursor();
  102. !     emsg_on_display = FALSE;    /* may remove error message now */
  103.       }
  104.   }
  105.   
  106.   /*
  107. --- 1556,1644 ----
  108.       int        conceal_update_lines = FALSE;
  109.   #endif
  110.   
  111. !     if (char_avail())
  112. !     return;
  113.   #if defined(FEAT_AUTOCMD) || defined(FEAT_CONCEAL)
  114. !     /* Trigger CursorMoved if the cursor moved.  Not when the popup menu is
  115. !      * visible, the command might delete it. */
  116. !     if (ready && (
  117.   # ifdef FEAT_AUTOCMD
  118. !         has_cursormovedI()
  119.   # endif
  120.   # if defined(FEAT_AUTOCMD) && defined(FEAT_CONCEAL)
  121. !         ||
  122.   # endif
  123.   # ifdef FEAT_CONCEAL
  124. !         curwin->w_p_cole > 0
  125.   # endif
  126. !         )
  127. !     && !equalpos(last_cursormoved, curwin->w_cursor)
  128.   # ifdef FEAT_INS_EXPAND
  129. !     && !pum_visible()
  130.   # endif
  131. !        )
  132. !     {
  133.   # ifdef FEAT_SYN_HL
  134. !     /* Need to update the screen first, to make sure syntax
  135. !      * highlighting is correct after making a change (e.g., inserting
  136. !      * a "(".  The autocommand may also require a redraw, so it's done
  137. !      * again below, unfortunately. */
  138. !     if (syntax_present(curwin) && must_redraw)
  139. !         update_screen(0);
  140.   # endif
  141.   # ifdef FEAT_AUTOCMD
  142. !     if (has_cursormovedI())
  143. !         apply_autocmds(EVENT_CURSORMOVEDI, NULL, NULL, FALSE, curbuf);
  144.   # endif
  145.   # ifdef FEAT_CONCEAL
  146. !     if (curwin->w_p_cole > 0)
  147. !     {
  148. !         conceal_old_cursor_line = last_cursormoved.lnum;
  149. !         conceal_new_cursor_line = curwin->w_cursor.lnum;
  150. !         conceal_update_lines = TRUE;
  151.       }
  152. + # endif
  153. +     last_cursormoved = curwin->w_cursor;
  154. +     }
  155.   #endif
  156.   #ifdef FEAT_AUTOCMD
  157. !     /* Trigger TextChangedI if b_changedtick differs. */
  158. !     if (ready && has_textchangedI()
  159. !         && last_changedtick != curbuf->b_changedtick
  160.   # ifdef FEAT_INS_EXPAND
  161. !         && !pum_visible()
  162.   # endif
  163. !         )
  164. !     {
  165. !     if (last_changedtick_buf == curbuf)
  166. !         apply_autocmds(EVENT_TEXTCHANGEDI, NULL, NULL, FALSE, curbuf);
  167. !     last_changedtick_buf = curbuf;
  168. !     last_changedtick = curbuf->b_changedtick;
  169. !     }
  170.   #endif
  171. !     if (must_redraw)
  172. !     update_screen(0);
  173. !     else if (clear_cmdline || redraw_cmdline)
  174. !     showmode();        /* clear cmdline and show mode */
  175.   # if defined(FEAT_CONCEAL)
  176. !     if ((conceal_update_lines
  177. !         && (conceal_old_cursor_line != conceal_new_cursor_line
  178. !         || conceal_cursor_line(curwin)))
  179. !         || need_cursor_line_redraw)
  180. !     {
  181. !     if (conceal_old_cursor_line != conceal_new_cursor_line)
  182. !         update_single_line(curwin, conceal_old_cursor_line);
  183. !     update_single_line(curwin, conceal_new_cursor_line == 0
  184. !                ? curwin->w_cursor.lnum : conceal_new_cursor_line);
  185. !     curwin->w_valid &= ~VALID_CROW;
  186.       }
  187. + # endif
  188. +     showruler(FALSE);
  189. +     setcursor();
  190. +     emsg_on_display = FALSE;    /* may remove error message now */
  191.   }
  192.   
  193.   /*
  194. *** ../vim-7.4.142/src/version.c    2014-01-12 13:24:46.000000000 +0100
  195. --- src/version.c    2014-01-14 12:15:50.000000000 +0100
  196. ***************
  197. *** 740,741 ****
  198. --- 740,743 ----
  199.   {   /* Add new patch number below this line */
  200. + /**/
  201. +     143,
  202.   /**/
  203.  
  204. -- 
  205. You are not really successful until someone claims he sat
  206. beside you in school.
  207.  
  208.  /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
  209. ///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
  210. \\\  an exciting new programming language -- http://www.Zimbu.org        ///
  211.  \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///
  212.