Skip to content

Commit

Permalink
Fixed #2
Browse files Browse the repository at this point in the history
  • Loading branch information
h-east committed Nov 28, 2015
1 parent 79d0990 commit d476432
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 8 deletions.
20 changes: 18 additions & 2 deletions src/gui.c
Original file line number Diff line number Diff line change
Expand Up @@ -3977,6 +3977,12 @@ gui_drag_scrollbar(sb, value, still_dragging)
if ((sb->wp == NULL || sb->wp == curwin) && pum_visible())
return;
#endif
#ifdef FEAT_CMDL_COMPL
/* Disallow scrolling the current window when the command-line completion
* popup menu is visible. */
if (clpum_visible())
return;
#endif

#ifdef FEAT_RIGHTLEFT
if (sb->wp == NULL && curwin->w_p_rl)
Expand Down Expand Up @@ -4466,13 +4472,18 @@ gui_do_scroll()
{
int type = VALID;

if (0
#ifdef FEAT_INS_EXPAND
if (pum_visible())
|| pum_visible()
#endif
#ifdef FEAT_CMDL_COMPL
|| clpum_visible()
#endif
)
{
type = NOT_VALID;
wp->w_lines_valid = 0;
}
#endif
/* Don't set must_redraw here, it may cause the popup menu to
* disappear when losing focus after a scrollbar drag. */
if (wp->w_redr_type < type)
Expand All @@ -4485,6 +4496,11 @@ gui_do_scroll()
if (pum_visible())
pum_redraw();
#endif
#ifdef FEAT_CMDL_COMPL
/* May need to redraw the command-line popup menu. */
if (clpum_visible())
clpum_redraw();
#endif

return (wp == curwin && !equalpos(curwin->w_cursor, old_cursor));
}
Expand Down
13 changes: 11 additions & 2 deletions src/move.c
Original file line number Diff line number Diff line change
Expand Up @@ -138,9 +138,12 @@ redraw_for_cursorline(wp)
#endif
)
&& (wp->w_valid & VALID_CROW) == 0
# ifdef FEAT_INS_EXPAND
#ifdef FEAT_INS_EXPAND
&& !pum_visible()
# endif
#endif
#ifdef FEAT_CMDL_COMPL
&& !clpum_visible()
#endif
)
redraw_win_later(wp, SOME_VALID);
}
Expand Down Expand Up @@ -822,6 +825,9 @@ validate_virtcol_win(wp)
if (wp->w_p_cuc
# ifdef FEAT_INS_EXPAND
&& !pum_visible()
# endif
# ifdef FEAT_CMDL_COMPL
&& !clpum_visible()
# endif
)
redraw_win_later(wp, SOME_VALID);
Expand Down Expand Up @@ -1195,6 +1201,9 @@ curs_columns(may_scroll)
if (curwin->w_p_cuc && (curwin->w_valid & VALID_VIRTCOL) == 0
# ifdef FEAT_INS_EXPAND
&& !pum_visible()
# endif
# ifdef FEAT_CMDL_COMPL
&& !clpum_visible()
# endif
)
redraw_later(SOME_VALID);
Expand Down
26 changes: 24 additions & 2 deletions src/screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -697,6 +697,11 @@ update_screen(type)
if (pum_visible())
pum_redraw();
#endif
#ifdef FEAT_CMDL_COMPL
/* May need to redraw the command-line popup menu. */
if (clpum_visible())
clpum_redraw();
#endif

#ifdef FEAT_WINDOWS
/* Reset b_mod_set flags. Going through all windows is probably faster
Expand Down Expand Up @@ -6645,6 +6650,11 @@ win_redr_status(wp)
/* don't update status line when popup menu is visible and may be
* drawn over it */
|| pum_visible()
#endif
#ifdef FEAT_CMDL_COMPL
/* don't update status line when command-line popup menu is visible
* and may be drawn over it */
|| clpum_visible()
#endif
)
{
Expand Down Expand Up @@ -10526,16 +10536,22 @@ showruler(always)
{
if (!always && !redrawing())
return;
if (0
#ifdef FEAT_INS_EXPAND
if (pum_visible())
|| pum_visible()
#endif
#ifdef FEAT_CMDL_COMPL
|| clpum_visible()
#endif
)
{
# ifdef FEAT_WINDOWS
/* Don't redraw right now, do it later. */
curwin->w_redr_status = TRUE;
# endif
return;
}
#endif

#if defined(FEAT_STL_OPT) && defined(FEAT_WINDOWS)
if ((*p_stl != NUL || *curwin->w_p_stl != NUL) && curwin->w_status_height)
{
Expand Down Expand Up @@ -10614,6 +10630,12 @@ win_redr_ruler(wp, always)
if (pum_visible())
return;
#endif
#ifdef FEAT_CMDL_COMPL
/* Don't draw the ruler when the command-line popup menu is visible, it may
* overlap. */
if (clpum_visible())
return;
#endif

#ifdef FEAT_STL_OPT
if (*p_ruf)
Expand Down
14 changes: 12 additions & 2 deletions src/term.c
Original file line number Diff line number Diff line change
Expand Up @@ -3172,8 +3172,18 @@ set_shellsize(width, height, mustset)
#endif
if (State & CMDLINE)
{
update_screen(NOT_VALID);
redrawcmdline();
#ifdef FEAT_CMDL_COMPL
if (clpum_visible())
{
redraw_later(NOT_VALID);
clpum_compl_show_pum(); /* This includes the redraw. */
}
else
#endif
{
update_screen(NOT_VALID);
redrawcmdline();
}
}
else
{
Expand Down

0 comments on commit d476432

Please sign in to comment.