Purpose of this patch :
Prevent the screen from updating if the pum is visible,
which results in a flashing effect. Only do it in the
rare cases, when it overlaps the pvw.
There is still an issue with this, if the completion
function is still searching after it had added some words
to the menu, at least with i_<C-P>.

Do not compute folds, while the pum is visible, which
makes backspacing in complete-mode more responsive.

Note: It looks like the comments about the statusbar
in popupmnu.c and screen.c are counteracting each other.
Why does popupmnu.c want to redraw it ?

I am using this for some time now on debian, I just
forgot about it.(In other words I have no problems.)

This patch is based on the latest cvs version, I hope
that's appropriate.

-ap
------------------------------------------------------------------

diff -cr src_clean/fold.c src/fold.c
*** src_clean/fold.c    2007-05-10 21:02:13.000000000 +0200
--- src/fold.c    2007-08-22 02:26:44.468315424 +0200
***************
*** 842,847 ****
--- 842,852 ----
 {
     fold_T    *fp;

+     /* Don't update folds, when in completion mode,
+      * this results in a far more responsive <C-H>/<BS> behaviour.
+      */
+     if ( ins_compl_active() )
+     return;
     /* Mark all folds from top to bot as maybe-small. */
     (void)foldFind(&curwin->w_folds, curwin->w_cursor.lnum, &fp);
     while (fp < (fold_T *)curwin->w_folds.ga_data + curwin->w_folds.ga_len
diff -cr src_clean/popupmnu.c src/popupmnu.c
*** src_clean/popupmnu.c    2007-08-08 22:49:17.000000000 +0200
--- src/popupmnu.c    2007-08-22 01:33:36.237000256 +0200
***************
*** 28,34 ****
 static int pum_row;            /* top row of pum */
 static int pum_col;            /* left column of pum */

- static int pum_do_redraw = FALSE;    /* do redraw anyway */

 static int pum_set_selected __ARGS((int n, int repeat));

--- 28,33 ----
***************
*** 631,650 ****
                 update_topline();
             }

!             /* Update the screen before drawing the popup menu.
!              * Enable updating the status lines. */
!             pum_do_redraw = TRUE;
             update_screen(0);
-             pum_do_redraw = FALSE;

             if (!resized && win_valid(curwin_save))
                 win_enter(curwin_save, TRUE);

             /* May need to update the screen again when there are
              * autocommands involved. */
-             pum_do_redraw = TRUE;
             update_screen(0);
-             pum_do_redraw = FALSE;
             }
         }
         }
--- 630,644 ----
                 update_topline();
             }

!             /* Update the screen before drawing the popup menu. */
             update_screen(0);

             if (!resized && win_valid(curwin_save))
                 win_enter(curwin_save, TRUE);

             /* May need to update the screen again when there are
              * autocommands involved. */
             update_screen(0);
             }
         }
         }
***************
*** 688,699 ****

 /*
  * Return TRUE if the popup menu is displayed.
-  * Overruled when "pum_do_redraw" is set, used to redraw the status 
lines.
  */
     int
 pum_visible()
 {
!     return !pum_do_redraw && pum_array != NULL;
 }

 /*
--- 682,692 ----

 /*
  * Return TRUE if the popup menu is displayed.
  */
     int
 pum_visible()
 {
!     return pum_array != NULL;
 }

 /*
diff -cr src_clean/screen.c src/screen.c
*** src_clean/screen.c    2007-08-05 20:10:49.000000000 +0200
--- src/screen.c    2007-08-22 02:46:28.307344536 +0200
***************
*** 194,199 ****
--- 194,208 ----
     win_T    *wp;
     int        type;
 {
+ #ifdef FEAT_INS_EXPAND
+     /* If the pum is visible, redraw only the prewiewwindow. */
+     /* This avoids the 'flickering' of most of the lines from the menu */
+     /* Does not affect all statuslines and unused lines in the buffer*/
+     if ( pum_visible() && !wp->w_p_pvw )
+     {
+     return;
+     }
+ #endif
     if (wp->w_redr_type < type)
     {
     wp->w_redr_type = type;
***************
*** 1520,1525 ****
--- 1529,1538 ----
         || (mod_top != 0
             && (lnum == mod_top
             || (lnum >= mod_top
+ #ifdef FEAT_INS_EXPAND
+                 /* This prevents the flickering of the pum, if 
fdm=syntax */
+                     && !pum_visible()
+ #endif
                 && (lnum < mod_bot
 #ifdef FEAT_SYN_HL
                 || did_update == DID_FOLD
***************
*** 1989,1994 ****
--- 2002,2013 ----
 # define FDC_OFF 0
 #endif

+ #ifdef FEAT_INS_EXPAND
+     /* This avoids the flickering of the pum lines drawn over unused 
lines*/
+     if (pum_visible() && !wp->w_p_pvw )
+     return;
+ #endif
+
 #ifdef FEAT_RIGHTLEFT
     if (wp->w_p_rl)
     {
***************
*** 5670,5676 ****
 #ifdef FEAT_INS_EXPAND
         /* don't update status line when popup menu is visible and may be
          * drawn over it */
!         || pum_visible()
 #endif
         )
     {
--- 5689,5696 ----
 #ifdef FEAT_INS_EXPAND
         /* don't update status line when popup menu is visible and may be
          * drawn over it */
!         /* But do updates for the previewwindow */
!         || ( pum_visible() && !wp->w_p_pvw )
 #endif
         )
     {
***************
*** 9315,9321 ****
     if (edit_submode != NULL)
         return;
     /* Don't draw the ruler when the popup menu is visible, it may 
overlap. */
!     if (pum_visible())
     return;
 #endif

--- 9335,9342 ----
     if (edit_submode != NULL)
         return;
     /* Don't draw the ruler when the popup menu is visible, it may 
overlap. */
!     /* But do update it for previewwindow */
!     if (pum_visible() && !wp->w_p_pvw )
     return;
 #endif



--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui