|
Karsten Hopp |
ee793c |
To: vim_dev@googlegroups.com
|
|
Karsten Hopp |
ee793c |
Subject: Patch 7.4.775
|
|
Karsten Hopp |
ee793c |
Fcc: outbox
|
|
Karsten Hopp |
ee793c |
From: Bram Moolenaar <Bram@moolenaar.net>
|
|
Karsten Hopp |
ee793c |
Mime-Version: 1.0
|
|
Karsten Hopp |
ee793c |
Content-Type: text/plain; charset=UTF-8
|
|
Karsten Hopp |
ee793c |
Content-Transfer-Encoding: 8bit
|
|
Karsten Hopp |
ee793c |
------------
|
|
Karsten Hopp |
ee793c |
|
|
Karsten Hopp |
ee793c |
Patch 7.4.775
|
|
Karsten Hopp |
ee793c |
Problem: It is not possible to avoid using the first item of completion.
|
|
Karsten Hopp |
ee793c |
Solution: Add the "noinsert" and "noselect" values to 'completeopt'. (Shougo
|
|
Karsten Hopp |
ee793c |
Matsu)
|
|
Karsten Hopp |
ee793c |
Files: runtime/doc/options.txt, src/edit.c, src/option.c
|
|
Karsten Hopp |
ee793c |
|
|
Karsten Hopp |
ee793c |
|
|
Karsten Hopp |
ee793c |
*** ../vim-7.4.774/runtime/doc/options.txt 2015-06-19 14:41:44.773813332 +0200
|
|
Karsten Hopp |
ee793c |
--- runtime/doc/options.txt 2015-07-10 18:02:02.584539984 +0200
|
|
Karsten Hopp |
ee793c |
***************
|
|
Karsten Hopp |
ee793c |
*** 1818,1823 ****
|
|
Karsten Hopp |
ee793c |
--- 1819,1832 ----
|
|
Karsten Hopp |
ee793c |
completion in the preview window. Only works in
|
|
Karsten Hopp |
ee793c |
combination with "menu" or "menuone".
|
|
Karsten Hopp |
ee793c |
|
|
Karsten Hopp |
ee793c |
+ noinsert Do not insert any text for a match until the user selects
|
|
Karsten Hopp |
ee793c |
+ a match from the menu. Only works in combination with
|
|
Karsten Hopp |
ee793c |
+ "menu" or "menuone". No effect if "longest" is present.
|
|
Karsten Hopp |
ee793c |
+
|
|
Karsten Hopp |
ee793c |
+ noselect Do not select a match in the menu, force the user to
|
|
Karsten Hopp |
ee793c |
+ select one from the menu. Only works in combination with
|
|
Karsten Hopp |
ee793c |
+ "menu" or "menuone".
|
|
Karsten Hopp |
ee793c |
+
|
|
Karsten Hopp |
ee793c |
|
|
Karsten Hopp |
ee793c |
*'concealcursor'* *'cocu'*
|
|
Karsten Hopp |
ee793c |
'concealcursor' 'cocu' string (default: "")
|
|
Karsten Hopp |
ee793c |
*** ../vim-7.4.774/src/edit.c 2015-07-10 17:56:18.215777193 +0200
|
|
Karsten Hopp |
ee793c |
--- src/edit.c 2015-07-10 18:05:16.054721894 +0200
|
|
Karsten Hopp |
ee793c |
***************
|
|
Karsten Hopp |
ee793c |
*** 108,113 ****
|
|
Karsten Hopp |
ee793c |
--- 108,118 ----
|
|
Karsten Hopp |
ee793c |
static int compl_get_longest = FALSE; /* put longest common string
|
|
Karsten Hopp |
ee793c |
in compl_leader */
|
|
Karsten Hopp |
ee793c |
|
|
Karsten Hopp |
ee793c |
+ static int compl_no_insert = FALSE; /* FALSE: select & insert
|
|
Karsten Hopp |
ee793c |
+ TRUE: noinsert */
|
|
Karsten Hopp |
ee793c |
+ static int compl_no_select = FALSE; /* FALSE: select & insert
|
|
Karsten Hopp |
ee793c |
+ TRUE: noselect */
|
|
Karsten Hopp |
ee793c |
+
|
|
Karsten Hopp |
ee793c |
static int compl_used_match; /* Selected one of the matches. When
|
|
Karsten Hopp |
ee793c |
FALSE the match was edited or using
|
|
Karsten Hopp |
ee793c |
the longest common string. */
|
|
Karsten Hopp |
ee793c |
***************
|
|
Karsten Hopp |
ee793c |
*** 2788,2794 ****
|
|
Karsten Hopp |
ee793c |
compl_cont_status = 0;
|
|
Karsten Hopp |
ee793c |
|
|
Karsten Hopp |
ee793c |
compl_curr_match = compl_first_match;
|
|
Karsten Hopp |
ee793c |
! ins_complete(Ctrl_N);
|
|
Karsten Hopp |
ee793c |
out_flush();
|
|
Karsten Hopp |
ee793c |
}
|
|
Karsten Hopp |
ee793c |
|
|
Karsten Hopp |
ee793c |
--- 2793,2809 ----
|
|
Karsten Hopp |
ee793c |
compl_cont_status = 0;
|
|
Karsten Hopp |
ee793c |
|
|
Karsten Hopp |
ee793c |
compl_curr_match = compl_first_match;
|
|
Karsten Hopp |
ee793c |
! if (compl_no_insert)
|
|
Karsten Hopp |
ee793c |
! {
|
|
Karsten Hopp |
ee793c |
! if (!compl_no_select)
|
|
Karsten Hopp |
ee793c |
! ins_complete(K_DOWN);
|
|
Karsten Hopp |
ee793c |
! }
|
|
Karsten Hopp |
ee793c |
! else
|
|
Karsten Hopp |
ee793c |
! {
|
|
Karsten Hopp |
ee793c |
! ins_complete(Ctrl_N);
|
|
Karsten Hopp |
ee793c |
! if (compl_no_select)
|
|
Karsten Hopp |
ee793c |
! ins_complete(Ctrl_P);
|
|
Karsten Hopp |
ee793c |
! }
|
|
Karsten Hopp |
ee793c |
out_flush();
|
|
Karsten Hopp |
ee793c |
}
|
|
Karsten Hopp |
ee793c |
|
|
Karsten Hopp |
ee793c |
***************
|
|
Karsten Hopp |
ee793c |
*** 3657,3666 ****
|
|
Karsten Hopp |
ee793c |
if (ctrl_x_mode == CTRL_X_NOT_DEFINED_YET
|
|
Karsten Hopp |
ee793c |
|| (ctrl_x_mode == 0 && !compl_started))
|
|
Karsten Hopp |
ee793c |
{
|
|
Karsten Hopp |
ee793c |
! compl_get_longest = (vim_strchr(p_cot, 'l') != NULL);
|
|
Karsten Hopp |
ee793c |
compl_used_match = TRUE;
|
|
Karsten Hopp |
ee793c |
}
|
|
Karsten Hopp |
ee793c |
|
|
Karsten Hopp |
ee793c |
if (ctrl_x_mode == CTRL_X_NOT_DEFINED_YET)
|
|
Karsten Hopp |
ee793c |
{
|
|
Karsten Hopp |
ee793c |
/*
|
|
Karsten Hopp |
ee793c |
--- 3672,3689 ----
|
|
Karsten Hopp |
ee793c |
if (ctrl_x_mode == CTRL_X_NOT_DEFINED_YET
|
|
Karsten Hopp |
ee793c |
|| (ctrl_x_mode == 0 && !compl_started))
|
|
Karsten Hopp |
ee793c |
{
|
|
Karsten Hopp |
ee793c |
! compl_get_longest = (strstr((char *)p_cot, "longest") != NULL);
|
|
Karsten Hopp |
ee793c |
compl_used_match = TRUE;
|
|
Karsten Hopp |
ee793c |
+
|
|
Karsten Hopp |
ee793c |
}
|
|
Karsten Hopp |
ee793c |
|
|
Karsten Hopp |
ee793c |
+ compl_no_insert = FALSE;
|
|
Karsten Hopp |
ee793c |
+ compl_no_select = FALSE;
|
|
Karsten Hopp |
ee793c |
+ if (strstr((char *)p_cot, "noselect") != NULL)
|
|
Karsten Hopp |
ee793c |
+ compl_no_select = TRUE;
|
|
Karsten Hopp |
ee793c |
+ if (strstr((char *)p_cot, "noinsert") != NULL)
|
|
Karsten Hopp |
ee793c |
+ compl_no_insert = TRUE;
|
|
Karsten Hopp |
ee793c |
+
|
|
Karsten Hopp |
ee793c |
if (ctrl_x_mode == CTRL_X_NOT_DEFINED_YET)
|
|
Karsten Hopp |
ee793c |
{
|
|
Karsten Hopp |
ee793c |
/*
|
|
Karsten Hopp |
ee793c |
***************
|
|
Karsten Hopp |
ee793c |
*** 4672,4677 ****
|
|
Karsten Hopp |
ee793c |
--- 4695,4701 ----
|
|
Karsten Hopp |
ee793c |
compl_T *found_compl = NULL;
|
|
Karsten Hopp |
ee793c |
int found_end = FALSE;
|
|
Karsten Hopp |
ee793c |
int advance;
|
|
Karsten Hopp |
ee793c |
+ int started = compl_started;
|
|
Karsten Hopp |
ee793c |
|
|
Karsten Hopp |
ee793c |
/* When user complete function return -1 for findstart which is next
|
|
Karsten Hopp |
ee793c |
* time of 'always', compl_shown_match become NULL. */
|
|
Karsten Hopp |
ee793c |
***************
|
|
Karsten Hopp |
ee793c |
*** 4753,4759 ****
|
|
Karsten Hopp |
ee793c |
return -1;
|
|
Karsten Hopp |
ee793c |
}
|
|
Karsten Hopp |
ee793c |
|
|
Karsten Hopp |
ee793c |
! if (advance)
|
|
Karsten Hopp |
ee793c |
{
|
|
Karsten Hopp |
ee793c |
if (compl_shows_dir == BACKWARD)
|
|
Karsten Hopp |
ee793c |
--compl_pending;
|
|
Karsten Hopp |
ee793c |
--- 4777,4783 ----
|
|
Karsten Hopp |
ee793c |
return -1;
|
|
Karsten Hopp |
ee793c |
}
|
|
Karsten Hopp |
ee793c |
|
|
Karsten Hopp |
ee793c |
! if (!compl_no_select && advance)
|
|
Karsten Hopp |
ee793c |
{
|
|
Karsten Hopp |
ee793c |
if (compl_shows_dir == BACKWARD)
|
|
Karsten Hopp |
ee793c |
--compl_pending;
|
|
Karsten Hopp |
ee793c |
***************
|
|
Karsten Hopp |
ee793c |
*** 4805,4811 ****
|
|
Karsten Hopp |
ee793c |
}
|
|
Karsten Hopp |
ee793c |
|
|
Karsten Hopp |
ee793c |
/* Insert the text of the new completion, or the compl_leader. */
|
|
Karsten Hopp |
ee793c |
! if (insert_match)
|
|
Karsten Hopp |
ee793c |
{
|
|
Karsten Hopp |
ee793c |
if (!compl_get_longest || compl_used_match)
|
|
Karsten Hopp |
ee793c |
ins_compl_insert();
|
|
Karsten Hopp |
ee793c |
--- 4829,4840 ----
|
|
Karsten Hopp |
ee793c |
}
|
|
Karsten Hopp |
ee793c |
|
|
Karsten Hopp |
ee793c |
/* Insert the text of the new completion, or the compl_leader. */
|
|
Karsten Hopp |
ee793c |
! if (compl_no_insert && !started)
|
|
Karsten Hopp |
ee793c |
! {
|
|
Karsten Hopp |
ee793c |
! ins_bytes(compl_orig_text + ins_compl_len());
|
|
Karsten Hopp |
ee793c |
! compl_used_match = FALSE;
|
|
Karsten Hopp |
ee793c |
! }
|
|
Karsten Hopp |
ee793c |
! else if (insert_match)
|
|
Karsten Hopp |
ee793c |
{
|
|
Karsten Hopp |
ee793c |
if (!compl_get_longest || compl_used_match)
|
|
Karsten Hopp |
ee793c |
ins_compl_insert();
|
|
Karsten Hopp |
ee793c |
***************
|
|
Karsten Hopp |
ee793c |
*** 4842,4848 ****
|
|
Karsten Hopp |
ee793c |
|
|
Karsten Hopp |
ee793c |
/* Enter will select a match when the match wasn't inserted and the popup
|
|
Karsten Hopp |
ee793c |
* menu is visible. */
|
|
Karsten Hopp |
ee793c |
! compl_enter_selects = !insert_match && compl_match_array != NULL;
|
|
Karsten Hopp |
ee793c |
|
|
Karsten Hopp |
ee793c |
/*
|
|
Karsten Hopp |
ee793c |
* Show the file name for the match (if any)
|
|
Karsten Hopp |
ee793c |
--- 4871,4880 ----
|
|
Karsten Hopp |
ee793c |
|
|
Karsten Hopp |
ee793c |
/* Enter will select a match when the match wasn't inserted and the popup
|
|
Karsten Hopp |
ee793c |
* menu is visible. */
|
|
Karsten Hopp |
ee793c |
! if (compl_no_insert && !started)
|
|
Karsten Hopp |
ee793c |
! compl_enter_selects = TRUE;
|
|
Karsten Hopp |
ee793c |
! else
|
|
Karsten Hopp |
ee793c |
! compl_enter_selects = !insert_match && compl_match_array != NULL;
|
|
Karsten Hopp |
ee793c |
|
|
Karsten Hopp |
ee793c |
/*
|
|
Karsten Hopp |
ee793c |
* Show the file name for the match (if any)
|
|
Karsten Hopp |
ee793c |
***************
|
|
Karsten Hopp |
ee793c |
*** 4917,4923 ****
|
|
Karsten Hopp |
ee793c |
}
|
|
Karsten Hopp |
ee793c |
}
|
|
Karsten Hopp |
ee793c |
}
|
|
Karsten Hopp |
ee793c |
! if (compl_pending != 0 && !got_int)
|
|
Karsten Hopp |
ee793c |
{
|
|
Karsten Hopp |
ee793c |
int todo = compl_pending > 0 ? compl_pending : -compl_pending;
|
|
Karsten Hopp |
ee793c |
|
|
Karsten Hopp |
ee793c |
--- 4949,4955 ----
|
|
Karsten Hopp |
ee793c |
}
|
|
Karsten Hopp |
ee793c |
}
|
|
Karsten Hopp |
ee793c |
}
|
|
Karsten Hopp |
ee793c |
! if (compl_pending != 0 && !got_int && !compl_no_insert)
|
|
Karsten Hopp |
ee793c |
{
|
|
Karsten Hopp |
ee793c |
int todo = compl_pending > 0 ? compl_pending : -compl_pending;
|
|
Karsten Hopp |
ee793c |
|
|
Karsten Hopp |
ee793c |
*** ../vim-7.4.774/src/option.c 2015-06-25 19:16:51.485906246 +0200
|
|
Karsten Hopp |
ee793c |
--- src/option.c 2015-07-10 17:59:17.526091062 +0200
|
|
Karsten Hopp |
ee793c |
***************
|
|
Karsten Hopp |
ee793c |
*** 3054,3060 ****
|
|
Karsten Hopp |
ee793c |
static char *(p_fcl_values[]) = {"all", NULL};
|
|
Karsten Hopp |
ee793c |
#endif
|
|
Karsten Hopp |
ee793c |
#ifdef FEAT_INS_EXPAND
|
|
Karsten Hopp |
ee793c |
! static char *(p_cot_values[]) = {"menu", "menuone", "longest", "preview", NULL};
|
|
Karsten Hopp |
ee793c |
#endif
|
|
Karsten Hopp |
ee793c |
|
|
Karsten Hopp |
ee793c |
static void set_option_default __ARGS((int, int opt_flags, int compatible));
|
|
Karsten Hopp |
ee793c |
--- 3054,3060 ----
|
|
Karsten Hopp |
ee793c |
static char *(p_fcl_values[]) = {"all", NULL};
|
|
Karsten Hopp |
ee793c |
#endif
|
|
Karsten Hopp |
ee793c |
#ifdef FEAT_INS_EXPAND
|
|
Karsten Hopp |
ee793c |
! static char *(p_cot_values[]) = {"menu", "menuone", "longest", "preview", "noinsert", "noselect", NULL};
|
|
Karsten Hopp |
ee793c |
#endif
|
|
Karsten Hopp |
ee793c |
|
|
Karsten Hopp |
ee793c |
static void set_option_default __ARGS((int, int opt_flags, int compatible));
|
|
Karsten Hopp |
ee793c |
*** ../vim-7.4.774/src/version.c 2015-07-10 17:56:18.219777154 +0200
|
|
Karsten Hopp |
ee793c |
--- src/version.c 2015-07-10 18:01:22.548916206 +0200
|
|
Karsten Hopp |
ee793c |
***************
|
|
Karsten Hopp |
ee793c |
*** 743,744 ****
|
|
Karsten Hopp |
ee793c |
--- 743,746 ----
|
|
Karsten Hopp |
ee793c |
{ /* Add new patch number below this line */
|
|
Karsten Hopp |
ee793c |
+ /**/
|
|
Karsten Hopp |
ee793c |
+ 775,
|
|
Karsten Hopp |
ee793c |
/**/
|
|
Karsten Hopp |
ee793c |
|
|
Karsten Hopp |
ee793c |
--
|
|
Karsten Hopp |
ee793c |
hundred-and-one symptoms of being an internet addict:
|
|
Karsten Hopp |
ee793c |
202. You're amazed to find out Spam is a food.
|
|
Karsten Hopp |
ee793c |
|
|
Karsten Hopp |
ee793c |
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
|
|
Karsten Hopp |
ee793c |
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
|
|
Karsten Hopp |
ee793c |
\\\ an exciting new programming language -- http://www.Zimbu.org ///
|
|
Karsten Hopp |
ee793c |
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|