Karsten Hopp b28ccf
To: vim_dev@googlegroups.com
Karsten Hopp b28ccf
Subject: Patch 7.3.181
Karsten Hopp b28ccf
Fcc: outbox
Karsten Hopp b28ccf
From: Bram Moolenaar <Bram@moolenaar.net>
Karsten Hopp b28ccf
Mime-Version: 1.0
Karsten Hopp b28ccf
Content-Type: text/plain; charset=UTF-8
Karsten Hopp b28ccf
Content-Transfer-Encoding: 8bit
Karsten Hopp b28ccf
------------
Karsten Hopp b28ccf
Karsten Hopp b28ccf
Patch 7.3.181
Karsten Hopp b28ccf
Problem:    When repeating the insert of CTRL-V or a digraph the display may
Karsten Hopp b28ccf
	    not be updated correctly.
Karsten Hopp b28ccf
Solution:   Only call edit_unputchar() after edit_putchar(). (Lech Lorens)
Karsten Hopp b28ccf
Files:	    src/edit.c
Karsten Hopp b28ccf
Karsten Hopp b28ccf
Karsten Hopp b28ccf
*** ../vim-7.3.180/src/edit.c	2010-11-10 17:11:29.000000000 +0100
Karsten Hopp b28ccf
--- src/edit.c	2011-05-10 14:16:41.000000000 +0200
Karsten Hopp b28ccf
***************
Karsten Hopp b28ccf
*** 1553,1564 ****
Karsten Hopp b28ccf
--- 1553,1568 ----
Karsten Hopp b28ccf
  ins_ctrl_v()
Karsten Hopp b28ccf
  {
Karsten Hopp b28ccf
      int		c;
Karsten Hopp b28ccf
+     int		did_putchar = FALSE;
Karsten Hopp b28ccf
  
Karsten Hopp b28ccf
      /* may need to redraw when no more chars available now */
Karsten Hopp b28ccf
      ins_redraw(FALSE);
Karsten Hopp b28ccf
  
Karsten Hopp b28ccf
      if (redrawing() && !char_avail())
Karsten Hopp b28ccf
+     {
Karsten Hopp b28ccf
  	edit_putchar('^', TRUE);
Karsten Hopp b28ccf
+ 	did_putchar = TRUE;
Karsten Hopp b28ccf
+     }
Karsten Hopp b28ccf
      AppendToRedobuff((char_u *)CTRL_V_STR);	/* CTRL-V */
Karsten Hopp b28ccf
  
Karsten Hopp b28ccf
  #ifdef FEAT_CMDL_INFO
Karsten Hopp b28ccf
***************
Karsten Hopp b28ccf
*** 1566,1573 ****
Karsten Hopp b28ccf
  #endif
Karsten Hopp b28ccf
  
Karsten Hopp b28ccf
      c = get_literal();
Karsten Hopp b28ccf
!     edit_unputchar();  /* when line fits in 'columns' the '^' is at the start
Karsten Hopp b28ccf
! 			  of the next line and will not be redrawn */
Karsten Hopp b28ccf
  #ifdef FEAT_CMDL_INFO
Karsten Hopp b28ccf
      clear_showcmd();
Karsten Hopp b28ccf
  #endif
Karsten Hopp b28ccf
--- 1570,1579 ----
Karsten Hopp b28ccf
  #endif
Karsten Hopp b28ccf
  
Karsten Hopp b28ccf
      c = get_literal();
Karsten Hopp b28ccf
!     if (did_putchar)
Karsten Hopp b28ccf
! 	/* when the line fits in 'columns' the '^' is at the start of the next
Karsten Hopp b28ccf
! 	 * line and will not removed by the redraw */
Karsten Hopp b28ccf
! 	edit_unputchar();
Karsten Hopp b28ccf
  #ifdef FEAT_CMDL_INFO
Karsten Hopp b28ccf
      clear_showcmd();
Karsten Hopp b28ccf
  #endif
Karsten Hopp b28ccf
***************
Karsten Hopp b28ccf
*** 9637,9642 ****
Karsten Hopp b28ccf
--- 9643,9649 ----
Karsten Hopp b28ccf
  {
Karsten Hopp b28ccf
      int	    c;
Karsten Hopp b28ccf
      int	    cc;
Karsten Hopp b28ccf
+     int	    did_putchar = FALSE;
Karsten Hopp b28ccf
  
Karsten Hopp b28ccf
      pc_status = PC_STATUS_UNSET;
Karsten Hopp b28ccf
      if (redrawing() && !char_avail())
Karsten Hopp b28ccf
***************
Karsten Hopp b28ccf
*** 9645,9650 ****
Karsten Hopp b28ccf
--- 9652,9658 ----
Karsten Hopp b28ccf
  	ins_redraw(FALSE);
Karsten Hopp b28ccf
  
Karsten Hopp b28ccf
  	edit_putchar('?', TRUE);
Karsten Hopp b28ccf
+ 	did_putchar = TRUE;
Karsten Hopp b28ccf
  #ifdef FEAT_CMDL_INFO
Karsten Hopp b28ccf
  	add_to_showcmd_c(Ctrl_K);
Karsten Hopp b28ccf
  #endif
Karsten Hopp b28ccf
***************
Karsten Hopp b28ccf
*** 9661,9668 ****
Karsten Hopp b28ccf
      c = plain_vgetc();
Karsten Hopp b28ccf
      --no_mapping;
Karsten Hopp b28ccf
      --allow_keys;
Karsten Hopp b28ccf
!     edit_unputchar();  /* when line fits in 'columns' the '?' is at the start
Karsten Hopp b28ccf
! 			  of the next line and will not be redrawn */
Karsten Hopp b28ccf
  
Karsten Hopp b28ccf
      if (IS_SPECIAL(c) || mod_mask)	    /* special key */
Karsten Hopp b28ccf
      {
Karsten Hopp b28ccf
--- 9669,9678 ----
Karsten Hopp b28ccf
      c = plain_vgetc();
Karsten Hopp b28ccf
      --no_mapping;
Karsten Hopp b28ccf
      --allow_keys;
Karsten Hopp b28ccf
!     if (did_putchar)
Karsten Hopp b28ccf
! 	/* when the line fits in 'columns' the '?' is at the start of the next
Karsten Hopp b28ccf
! 	 * line and will not be removed by the redraw */
Karsten Hopp b28ccf
! 	edit_unputchar();
Karsten Hopp b28ccf
  
Karsten Hopp b28ccf
      if (IS_SPECIAL(c) || mod_mask)	    /* special key */
Karsten Hopp b28ccf
      {
Karsten Hopp b28ccf
***************
Karsten Hopp b28ccf
*** 9674,9679 ****
Karsten Hopp b28ccf
--- 9684,9690 ----
Karsten Hopp b28ccf
      }
Karsten Hopp b28ccf
      if (c != ESC)
Karsten Hopp b28ccf
      {
Karsten Hopp b28ccf
+ 	did_putchar = FALSE;
Karsten Hopp b28ccf
  	if (redrawing() && !char_avail())
Karsten Hopp b28ccf
  	{
Karsten Hopp b28ccf
  	    /* may need to redraw when no more chars available now */
Karsten Hopp b28ccf
***************
Karsten Hopp b28ccf
*** 9681,9691 ****
Karsten Hopp b28ccf
  
Karsten Hopp b28ccf
  	    if (char2cells(c) == 1)
Karsten Hopp b28ccf
  	    {
Karsten Hopp b28ccf
- 		/* first remove the '?', otherwise it's restored when typing
Karsten Hopp b28ccf
- 		 * an ESC next */
Karsten Hopp b28ccf
- 		edit_unputchar();
Karsten Hopp b28ccf
  		ins_redraw(FALSE);
Karsten Hopp b28ccf
  		edit_putchar(c, TRUE);
Karsten Hopp b28ccf
  	    }
Karsten Hopp b28ccf
  #ifdef FEAT_CMDL_INFO
Karsten Hopp b28ccf
  	    add_to_showcmd_c(c);
Karsten Hopp b28ccf
--- 9692,9700 ----
Karsten Hopp b28ccf
  
Karsten Hopp b28ccf
  	    if (char2cells(c) == 1)
Karsten Hopp b28ccf
  	    {
Karsten Hopp b28ccf
  		ins_redraw(FALSE);
Karsten Hopp b28ccf
  		edit_putchar(c, TRUE);
Karsten Hopp b28ccf
+ 		did_putchar = TRUE;
Karsten Hopp b28ccf
  	    }
Karsten Hopp b28ccf
  #ifdef FEAT_CMDL_INFO
Karsten Hopp b28ccf
  	    add_to_showcmd_c(c);
Karsten Hopp b28ccf
***************
Karsten Hopp b28ccf
*** 9696,9703 ****
Karsten Hopp b28ccf
  	cc = plain_vgetc();
Karsten Hopp b28ccf
  	--no_mapping;
Karsten Hopp b28ccf
  	--allow_keys;
Karsten Hopp b28ccf
! 	edit_unputchar();  /* when line fits in 'columns' the '?' is at the
Karsten Hopp b28ccf
! 			      start of the next line and will not be redrawn */
Karsten Hopp b28ccf
  	if (cc != ESC)
Karsten Hopp b28ccf
  	{
Karsten Hopp b28ccf
  	    AppendToRedobuff((char_u *)CTRL_V_STR);
Karsten Hopp b28ccf
--- 9705,9714 ----
Karsten Hopp b28ccf
  	cc = plain_vgetc();
Karsten Hopp b28ccf
  	--no_mapping;
Karsten Hopp b28ccf
  	--allow_keys;
Karsten Hopp b28ccf
! 	if (did_putchar)
Karsten Hopp b28ccf
! 	    /* when the line fits in 'columns' the '?' is at the start of the
Karsten Hopp b28ccf
! 	     * next line and will not be removed by a redraw */
Karsten Hopp b28ccf
! 	    edit_unputchar();
Karsten Hopp b28ccf
  	if (cc != ESC)
Karsten Hopp b28ccf
  	{
Karsten Hopp b28ccf
  	    AppendToRedobuff((char_u *)CTRL_V_STR);
Karsten Hopp b28ccf
*** ../vim-7.3.180/src/version.c	2011-05-10 13:38:23.000000000 +0200
Karsten Hopp b28ccf
--- src/version.c	2011-05-10 14:20:40.000000000 +0200
Karsten Hopp b28ccf
***************
Karsten Hopp b28ccf
*** 716,717 ****
Karsten Hopp b28ccf
--- 716,719 ----
Karsten Hopp b28ccf
  {   /* Add new patch number below this line */
Karsten Hopp b28ccf
+ /**/
Karsten Hopp b28ccf
+     181,
Karsten Hopp b28ccf
  /**/
Karsten Hopp b28ccf
Karsten Hopp b28ccf
-- 
Karsten Hopp b28ccf
hundred-and-one symptoms of being an internet addict:
Karsten Hopp b28ccf
74. Your most erotic dreams are about cybersex
Karsten Hopp b28ccf
Karsten Hopp b28ccf
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
Karsten Hopp b28ccf
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
Karsten Hopp b28ccf
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
Karsten Hopp b28ccf
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///