dcaee6
To: vim_dev@googlegroups.com
dcaee6
Subject: Patch 7.4.143
dcaee6
Fcc: outbox
dcaee6
From: Bram Moolenaar <Bram@moolenaar.net>
dcaee6
Mime-Version: 1.0
dcaee6
Content-Type: text/plain; charset=UTF-8
dcaee6
Content-Transfer-Encoding: 8bit
dcaee6
------------
dcaee6
dcaee6
Patch 7.4.143
dcaee6
Problem:    TextChangedI is not triggered.
dcaee6
Solution:   Reverse check for "ready". (lilydjwg)
dcaee6
Files:	    src/edit.c
dcaee6
dcaee6
dcaee6
*** ../vim-7.4.142/src/edit.c	2013-11-06 04:01:31.000000000 +0100
dcaee6
--- src/edit.c	2014-01-12 13:30:53.000000000 +0100
dcaee6
***************
dcaee6
*** 1556,1642 ****
dcaee6
      int		conceal_update_lines = FALSE;
dcaee6
  #endif
dcaee6
  
dcaee6
!     if (!char_avail())
dcaee6
!     {
dcaee6
  #if defined(FEAT_AUTOCMD) || defined(FEAT_CONCEAL)
dcaee6
! 	/* Trigger CursorMoved if the cursor moved.  Not when the popup menu is
dcaee6
! 	 * visible, the command might delete it. */
dcaee6
! 	if (ready && (
dcaee6
  # ifdef FEAT_AUTOCMD
dcaee6
! 		    has_cursormovedI()
dcaee6
  # endif
dcaee6
  # if defined(FEAT_AUTOCMD) && defined(FEAT_CONCEAL)
dcaee6
! 		    ||
dcaee6
  # endif
dcaee6
  # ifdef FEAT_CONCEAL
dcaee6
! 		    curwin->w_p_cole > 0
dcaee6
  # endif
dcaee6
! 		    )
dcaee6
! 	    && !equalpos(last_cursormoved, curwin->w_cursor)
dcaee6
  # ifdef FEAT_INS_EXPAND
dcaee6
! 	    && !pum_visible()
dcaee6
  # endif
dcaee6
! 	   )
dcaee6
! 	{
dcaee6
  # ifdef FEAT_SYN_HL
dcaee6
! 	    /* Need to update the screen first, to make sure syntax
dcaee6
! 	     * highlighting is correct after making a change (e.g., inserting
dcaee6
! 	     * a "(".  The autocommand may also require a redraw, so it's done
dcaee6
! 	     * again below, unfortunately. */
dcaee6
! 	    if (syntax_present(curwin) && must_redraw)
dcaee6
! 		update_screen(0);
dcaee6
  # endif
dcaee6
  # ifdef FEAT_AUTOCMD
dcaee6
! 	    if (has_cursormovedI())
dcaee6
! 		apply_autocmds(EVENT_CURSORMOVEDI, NULL, NULL, FALSE, curbuf);
dcaee6
  # endif
dcaee6
  # ifdef FEAT_CONCEAL
dcaee6
! 	    if (curwin->w_p_cole > 0)
dcaee6
! 	    {
dcaee6
! 		conceal_old_cursor_line = last_cursormoved.lnum;
dcaee6
! 		conceal_new_cursor_line = curwin->w_cursor.lnum;
dcaee6
! 		conceal_update_lines = TRUE;
dcaee6
! 	    }
dcaee6
! # endif
dcaee6
! 	    last_cursormoved = curwin->w_cursor;
dcaee6
  	}
dcaee6
  #endif
dcaee6
  #ifdef FEAT_AUTOCMD
dcaee6
! 	/* Trigger TextChangedI if b_changedtick differs. */
dcaee6
! 	if (!ready && has_textchangedI()
dcaee6
! 		&& last_changedtick != curbuf->b_changedtick
dcaee6
  # ifdef FEAT_INS_EXPAND
dcaee6
! 		&& !pum_visible()
dcaee6
  # endif
dcaee6
! 		)
dcaee6
! 	{
dcaee6
! 	    if (last_changedtick_buf == curbuf)
dcaee6
! 		apply_autocmds(EVENT_TEXTCHANGEDI, NULL, NULL, FALSE, curbuf);
dcaee6
! 	    last_changedtick_buf = curbuf;
dcaee6
! 	    last_changedtick = curbuf->b_changedtick;
dcaee6
! 	}
dcaee6
  #endif
dcaee6
! 	if (must_redraw)
dcaee6
! 	    update_screen(0);
dcaee6
! 	else if (clear_cmdline || redraw_cmdline)
dcaee6
! 	    showmode();		/* clear cmdline and show mode */
dcaee6
  # if defined(FEAT_CONCEAL)
dcaee6
! 	if ((conceal_update_lines
dcaee6
! 		&& (conceal_old_cursor_line != conceal_new_cursor_line
dcaee6
! 		    || conceal_cursor_line(curwin)))
dcaee6
! 		|| need_cursor_line_redraw)
dcaee6
! 	{
dcaee6
! 	    if (conceal_old_cursor_line != conceal_new_cursor_line)
dcaee6
! 		update_single_line(curwin, conceal_old_cursor_line);
dcaee6
! 	    update_single_line(curwin, conceal_new_cursor_line == 0
dcaee6
! 			   ? curwin->w_cursor.lnum : conceal_new_cursor_line);
dcaee6
! 	    curwin->w_valid &= ~VALID_CROW;
dcaee6
! 	}
dcaee6
! # endif
dcaee6
! 	showruler(FALSE);
dcaee6
! 	setcursor();
dcaee6
! 	emsg_on_display = FALSE;	/* may remove error message now */
dcaee6
      }
dcaee6
  }
dcaee6
  
dcaee6
  /*
dcaee6
--- 1556,1644 ----
dcaee6
      int		conceal_update_lines = FALSE;
dcaee6
  #endif
dcaee6
  
dcaee6
!     if (char_avail())
dcaee6
! 	return;
dcaee6
! 
dcaee6
  #if defined(FEAT_AUTOCMD) || defined(FEAT_CONCEAL)
dcaee6
!     /* Trigger CursorMoved if the cursor moved.  Not when the popup menu is
dcaee6
!      * visible, the command might delete it. */
dcaee6
!     if (ready && (
dcaee6
  # ifdef FEAT_AUTOCMD
dcaee6
! 		has_cursormovedI()
dcaee6
  # endif
dcaee6
  # if defined(FEAT_AUTOCMD) && defined(FEAT_CONCEAL)
dcaee6
! 		||
dcaee6
  # endif
dcaee6
  # ifdef FEAT_CONCEAL
dcaee6
! 		curwin->w_p_cole > 0
dcaee6
  # endif
dcaee6
! 		)
dcaee6
! 	&& !equalpos(last_cursormoved, curwin->w_cursor)
dcaee6
  # ifdef FEAT_INS_EXPAND
dcaee6
! 	&& !pum_visible()
dcaee6
  # endif
dcaee6
!        )
dcaee6
!     {
dcaee6
  # ifdef FEAT_SYN_HL
dcaee6
! 	/* Need to update the screen first, to make sure syntax
dcaee6
! 	 * highlighting is correct after making a change (e.g., inserting
dcaee6
! 	 * a "(".  The autocommand may also require a redraw, so it's done
dcaee6
! 	 * again below, unfortunately. */
dcaee6
! 	if (syntax_present(curwin) && must_redraw)
dcaee6
! 	    update_screen(0);
dcaee6
  # endif
dcaee6
  # ifdef FEAT_AUTOCMD
dcaee6
! 	if (has_cursormovedI())
dcaee6
! 	    apply_autocmds(EVENT_CURSORMOVEDI, NULL, NULL, FALSE, curbuf);
dcaee6
  # endif
dcaee6
  # ifdef FEAT_CONCEAL
dcaee6
! 	if (curwin->w_p_cole > 0)
dcaee6
! 	{
dcaee6
! 	    conceal_old_cursor_line = last_cursormoved.lnum;
dcaee6
! 	    conceal_new_cursor_line = curwin->w_cursor.lnum;
dcaee6
! 	    conceal_update_lines = TRUE;
dcaee6
  	}
dcaee6
+ # endif
dcaee6
+ 	last_cursormoved = curwin->w_cursor;
dcaee6
+     }
dcaee6
  #endif
dcaee6
+ 
dcaee6
  #ifdef FEAT_AUTOCMD
dcaee6
!     /* Trigger TextChangedI if b_changedtick differs. */
dcaee6
!     if (ready && has_textchangedI()
dcaee6
! 	    && last_changedtick != curbuf->b_changedtick
dcaee6
  # ifdef FEAT_INS_EXPAND
dcaee6
! 	    && !pum_visible()
dcaee6
  # endif
dcaee6
! 	    )
dcaee6
!     {
dcaee6
! 	if (last_changedtick_buf == curbuf)
dcaee6
! 	    apply_autocmds(EVENT_TEXTCHANGEDI, NULL, NULL, FALSE, curbuf);
dcaee6
! 	last_changedtick_buf = curbuf;
dcaee6
! 	last_changedtick = curbuf->b_changedtick;
dcaee6
!     }
dcaee6
  #endif
dcaee6
! 
dcaee6
!     if (must_redraw)
dcaee6
! 	update_screen(0);
dcaee6
!     else if (clear_cmdline || redraw_cmdline)
dcaee6
! 	showmode();		/* clear cmdline and show mode */
dcaee6
  # if defined(FEAT_CONCEAL)
dcaee6
!     if ((conceal_update_lines
dcaee6
! 	    && (conceal_old_cursor_line != conceal_new_cursor_line
dcaee6
! 		|| conceal_cursor_line(curwin)))
dcaee6
! 	    || need_cursor_line_redraw)
dcaee6
!     {
dcaee6
! 	if (conceal_old_cursor_line != conceal_new_cursor_line)
dcaee6
! 	    update_single_line(curwin, conceal_old_cursor_line);
dcaee6
! 	update_single_line(curwin, conceal_new_cursor_line == 0
dcaee6
! 		       ? curwin->w_cursor.lnum : conceal_new_cursor_line);
dcaee6
! 	curwin->w_valid &= ~VALID_CROW;
dcaee6
      }
dcaee6
+ # endif
dcaee6
+     showruler(FALSE);
dcaee6
+     setcursor();
dcaee6
+     emsg_on_display = FALSE;	/* may remove error message now */
dcaee6
  }
dcaee6
  
dcaee6
  /*
dcaee6
*** ../vim-7.4.142/src/version.c	2014-01-12 13:24:46.000000000 +0100
dcaee6
--- src/version.c	2014-01-14 12:15:50.000000000 +0100
dcaee6
***************
dcaee6
*** 740,741 ****
dcaee6
--- 740,743 ----
dcaee6
  {   /* Add new patch number below this line */
dcaee6
+ /**/
dcaee6
+     143,
dcaee6
  /**/
dcaee6
dcaee6
-- 
dcaee6
You are not really successful until someone claims he sat
dcaee6
beside you in school.
dcaee6
dcaee6
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
dcaee6
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
dcaee6
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
dcaee6
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///