jkunstle / rpms / vim

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