vim-patch:8.1.1901: the +insert_expand feature is not always available

Problem:    The +insert_expand feature is not always available.
Solution:   Graduate the +insert_expand feature.
e2c453d38f
This commit is contained in:
Jan Edmund Lazo
2021-03-01 22:07:48 -05:00
parent e50875b3e3
commit a5bacdbfb4
4 changed files with 12 additions and 15 deletions

View File

@@ -287,8 +287,7 @@ character is written at the end of each line. Thus if you want to insert a
*i_CTRL-X* *insert_expand* *i_CTRL-X* *insert_expand*
CTRL-X enters a sub-mode where several commands can be used. Most of these CTRL-X enters a sub-mode where several commands can be used. Most of these
commands do keyword completion; see |ins-completion|. These are not available commands do keyword completion; see |ins-completion|.
when Vim was compiled without the |+insert_expand| feature.
Two commands can be used to scroll the window up or down, without exiting Two commands can be used to scroll the window up or down, without exiting
insert mode: insert mode:
@@ -592,9 +591,6 @@ In Insert and Replace mode, there are several commands to complete part of a
keyword or line that has been typed. This is useful if you are using keyword or line that has been typed. This is useful if you are using
complicated keywords (e.g., function names with capitals and underscores). complicated keywords (e.g., function names with capitals and underscores).
These commands are not available when the |+insert_expand| feature was
disabled at compile time.
Completion can be done for: Completion can be done for:
1. Whole lines |i_CTRL-X_CTRL-L| 1. Whole lines |i_CTRL-X_CTRL-L|

View File

@@ -4090,8 +4090,6 @@ A jump table for the options with a short description can be found at |Q_op|.
In the "popup" model the right mouse button produces a pop-up menu. In the "popup" model the right mouse button produces a pop-up menu.
You need to define this first, see |popup-menu|. You need to define this first, see |popup-menu|.
In a terminal the popup menu works if Vim is compiled with the
|+insert_expand| option.
Note that you can further refine the meaning of buttons with mappings. Note that you can further refine the meaning of buttons with mappings.
See |mouse-overview|. But mappings are NOT used for modeless selection. See |mouse-overview|. But mappings are NOT used for modeless selection.

View File

@@ -180,6 +180,11 @@ EXTERN int compl_cont_status INIT(= 0);
# define CONT_LOCAL 32 // for ctrl_x_mode 0, ^X^P/^X^N do a local # define CONT_LOCAL 32 // for ctrl_x_mode 0, ^X^P/^X^N do a local
// expansion, (eg use complete=.) // expansion, (eg use complete=.)
EXTERN char_u *edit_submode INIT(= NULL); // msg for CTRL-X submode
EXTERN char_u *edit_submode_pre INIT(= NULL); // prepended to edit_submode
EXTERN char_u *edit_submode_extra INIT(= NULL); // appended to edit_submode
EXTERN hlf_T edit_submode_highl; // highl. method for extra info
// state for putting characters in the message area // state for putting characters in the message area
EXTERN int cmdmsg_rl INIT(= false); // cmdline is drawn right to left EXTERN int cmdmsg_rl INIT(= false); // cmdline is drawn right to left
EXTERN int msg_col; EXTERN int msg_col;
@@ -639,10 +644,6 @@ EXTERN int arrow_used; // Normally false, set to true after
// to call u_sync() // to call u_sync()
EXTERN bool ins_at_eol INIT(= false); // put cursor after eol when EXTERN bool ins_at_eol INIT(= false); // put cursor after eol when
// restarting edit after CTRL-O // restarting edit after CTRL-O
EXTERN char_u *edit_submode INIT(= NULL); // msg for CTRL-X submode
EXTERN char_u *edit_submode_pre INIT(= NULL); // prepended to edit_submode
EXTERN char_u *edit_submode_extra INIT(= NULL); // appended to edit_submode
EXTERN hlf_T edit_submode_highl; // highl. method for extra info
EXTERN int no_abbr INIT(= true); // true when no abbreviations loaded EXTERN int no_abbr INIT(= true); // true when no abbreviations loaded

View File

@@ -7152,11 +7152,13 @@ static void win_redr_ruler(win_T *wp, int always)
if (wp->w_cursor.lnum > wp->w_buffer->b_ml.ml_line_count) if (wp->w_cursor.lnum > wp->w_buffer->b_ml.ml_line_count)
return; return;
/* Don't draw the ruler while doing insert-completion, it might overwrite // Don't draw the ruler while doing insert-completion, it might overwrite
* the (long) mode message. */ // the (long) mode message.
if (wp == lastwin && lastwin->w_status_height == 0) if (wp == lastwin && lastwin->w_status_height == 0) {
if (edit_submode != NULL) if (edit_submode != NULL) {
return; return;
}
}
if (*p_ruf) { if (*p_ruf) {
int save_called_emsg = called_emsg; int save_called_emsg = called_emsg;