Blame SOURCES/7.4.143

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