0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 9.0.0747: too many #ifdefs

Problem:    Too many #ifdefs.
Solution:   Gradudate the +cmdline_info feature. (Martin Tournoij,
            closes #11330)
This commit is contained in:
Martin Tournoij
2022-10-13 22:12:15 +01:00
committed by Bram Moolenaar
parent 856c5d2bc7
commit ba43e76fcd
25 changed files with 40 additions and 172 deletions

View File

@@ -3077,9 +3077,7 @@ vgetorpeek(int advance)
// 'ttimeoutlen' for complete key code
int mapdepth = 0; // check for recursive mapping
int mode_deleted = FALSE; // set when mode has been deleted
#ifdef FEAT_CMDL_INFO
int new_wcol, new_wrow;
#endif
#ifdef FEAT_GUI
int shape_changed = FALSE; // adjusted cursor shape
#endif
@@ -3149,9 +3147,7 @@ vgetorpeek(int advance)
{
long wait_time;
int keylen = 0;
#ifdef FEAT_CMDL_INFO
int showcmd_idx;
#endif
check_end_reg_executing(advance);
/*
* ui_breakcheck() is slow, don't use it too often when
@@ -3249,10 +3245,8 @@ vgetorpeek(int advance)
* place does not matter.
*/
c = 0;
#ifdef FEAT_CMDL_INFO
new_wcol = curwin->w_wcol;
new_wrow = curwin->w_wrow;
#endif
if ( advance
&& typebuf.tb_len == 1
&& typebuf.tb_buf[typebuf.tb_off] == ESC
@@ -3351,10 +3345,8 @@ vgetorpeek(int advance)
}
setcursor();
out_flush();
#ifdef FEAT_CMDL_INFO
new_wcol = curwin->w_wcol;
new_wrow = curwin->w_wrow;
#endif
curwin->w_wcol = old_wcol;
curwin->w_wrow = old_wrow;
}
@@ -3442,9 +3434,7 @@ vgetorpeek(int advance)
* input from the user), show the partially matched characters
* to the user with showcmd.
*/
#ifdef FEAT_CMDL_INFO
showcmd_idx = 0;
#endif
c1 = 0;
if (typebuf.tb_len > 0 && advance && !exmode_active)
{
@@ -3462,7 +3452,6 @@ vgetorpeek(int advance)
setcursor(); // put cursor back where it belongs
c1 = 1;
}
#ifdef FEAT_CMDL_INFO
// need to use the col and row from above here
old_wcol = curwin->w_wcol;
old_wrow = curwin->w_wrow;
@@ -3476,7 +3465,6 @@ vgetorpeek(int advance)
typebuf.tb_buf[typebuf.tb_off + showcmd_idx++]);
curwin->w_wcol = old_wcol;
curwin->w_wrow = old_wrow;
#endif
}
// this looks nice when typing a dead character map
@@ -3521,10 +3509,8 @@ vgetorpeek(int advance)
typebuf.tb_buflen - typebuf.tb_off - typebuf.tb_len - 1,
wait_time);
#ifdef FEAT_CMDL_INFO
if (showcmd_idx != 0)
pop_showcmd();
#endif
if (c1 == 1)
{
if (State & MODE_INSERT)