3e025d3
To: vim-dev@vim.org
3e025d3
Subject: Patch 7.2.390
3e025d3
Fcc: outbox
3e025d3
From: Bram Moolenaar <Bram@moolenaar.net>
3e025d3
Mime-Version: 1.0
3e025d3
Content-Type: text/plain; charset=UTF-8
3e025d3
Content-Transfer-Encoding: 8bit
3e025d3
------------
3e025d3
3e025d3
Patch 7.2.390
3e025d3
Problem:    In some situations the popup menu can be displayed wrong.
3e025d3
Solution:   Remove the popup menu if the cursor moved. (Lech Lorens)
3e025d3
Files:	    src/edit.c
3e025d3
3e025d3
3e025d3
*** ../vim-7.2.389/src/edit.c	2010-01-19 14:59:14.000000000 +0100
3e025d3
--- src/edit.c	2010-03-10 14:09:56.000000000 +0100
3e025d3
***************
3e025d3
*** 4684,4689 ****
3e025d3
--- 4684,4690 ----
3e025d3
      int		startcol = 0;	    /* column where searched text starts */
3e025d3
      colnr_T	curs_col;	    /* cursor column */
3e025d3
      int		n;
3e025d3
+     int		save_w_wrow;
3e025d3
  
3e025d3
      compl_direction = ins_compl_key2dir(c);
3e025d3
      if (!compl_started)
3e025d3
***************
3e025d3
*** 5067,5072 ****
3e025d3
--- 5068,5074 ----
3e025d3
      /*
3e025d3
       * Find next match (and following matches).
3e025d3
       */
3e025d3
+     save_w_wrow = curwin->w_wrow;
3e025d3
      n = ins_compl_next(TRUE, ins_compl_key2count(c), ins_compl_use_match(c));
3e025d3
  
3e025d3
      /* may undisplay the popup menu */
3e025d3
***************
3e025d3
*** 5220,5225 ****
3e025d3
--- 5222,5233 ----
3e025d3
  	/* RedrawingDisabled may be set when invoked through complete(). */
3e025d3
  	n = RedrawingDisabled;
3e025d3
  	RedrawingDisabled = 0;
3e025d3
+ 
3e025d3
+ 	/* If the cursor moved we need to remove the pum first. */
3e025d3
+ 	setcursor();
3e025d3
+ 	if (save_w_wrow != curwin->w_wrow)
3e025d3
+ 	    ins_compl_del_pum();
3e025d3
+ 
3e025d3
  	ins_compl_show_pum();
3e025d3
  	setcursor();
3e025d3
  	RedrawingDisabled = n;
3e025d3
*** ../vim-7.2.389/src/version.c	2010-03-10 13:43:22.000000000 +0100
3e025d3
--- src/version.c	2010-03-10 14:13:55.000000000 +0100
3e025d3
***************
3e025d3
*** 683,684 ****
3e025d3
--- 683,686 ----
3e025d3
  {   /* Add new patch number below this line */
3e025d3
+ /**/
3e025d3
+     390,
3e025d3
  /**/
3e025d3
3e025d3
-- 
3e025d3
`When any government, or any church for that matter, undertakes to say to
3e025d3
 its subjects, "This you may not read, this you must not see, this you are
3e025d3
 forbidden to know," the end result is tyranny and oppression no matter how
3e025d3
 holy the motives' -- Robert A Heinlein, "If this goes on --"
3e025d3
3e025d3
 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
3e025d3
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
3e025d3
\\\        download, build and distribute -- http://www.A-A-P.org        ///
3e025d3
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///