Hi vim_dev!
On Di, 06 Jan 2015, Christian Brabandt wrote:
> Am 2015-01-05 20:02, schrieb Amadeus Demarzi:
> >I just tested this patch, and it doesn't quite work the way it had
> >originally (before this bug).
> >
> >I have the following map in my .vimrc:
> >
> >inoremap <c-l> <esc>A
> >
> >I often use that to jump to the end of a line while in insert mode.
> >However, this patch just means that nothing happens when I press
> ><c-l>, whereas before the cursor would jump to the end of the line.
> >Now I have to first close the pop up, and then I can use <c-l>.
> >
> >So it's good in the sense that it fixes the previous issue where <c-l>
> >would cycle through the popup options, however now it just prevents
> >anything from happening.
>
> I am not sure I understand. Remapped insertmode completion keys
> won't work when
> the popup menu is shown. That means, your imaped <c-l> didn't work in an
> unpatched vim when the popup menu was displayed.
> At least, that is what I am seeing here.
>
> (Internally, Vim uses the complete-line mode for the complete() function
> and that's why the <c-l> did select the previous item. I think, one
> should
> use a special state for the complete() function instead of
> (re-)using the
> line completion mode. Then <C-L> should just work)
Here is a patch, that does that and fixes the CTRL-L behaviour. Also the
inoremap <c-l> case should work when used in a popupmenu started by the
completion() function.
Best,
Christian
--
Was ist Ketzerei?
Die Meinung aller, die nicht so denken wie wir.
-- Friedrich II. der Große
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.
diff --git a/src/edit.c b/src/edit.c
--- a/src/edit.c
+++ b/src/edit.c
@@ -34,6 +34,7 @@
#define CTRL_X_OMNI 13
#define CTRL_X_SPELL 14
#define CTRL_X_LOCAL_MSG 15 /* only used in "ctrl_x_msgs" */
+#define CTRL_X_COMPLETE 16 /* complete function */
#define CTRL_X_MSG(i) ctrl_x_msgs[(i) & ~CTRL_X_WANT_IDENT]
@@ -2242,6 +2243,8 @@ vim_is_ctrl_x_key(c)
return (c == Ctrl_Y || c == Ctrl_E);
case CTRL_X_WHOLE_LINE:
return (c == Ctrl_L || c == Ctrl_P || c == Ctrl_N);
+ case CTRL_X_COMPLETE:
+ return (c == Ctrl_P || c == Ctrl_N);
case CTRL_X_FILES:
return (c == Ctrl_F || c == Ctrl_P || c == Ctrl_N);
case CTRL_X_DICTIONARY:
@@ -2774,7 +2777,7 @@ set_completion(startcol, list)
return;
/* Handle like dictionary completion. */
- ctrl_x_mode = CTRL_X_WHOLE_LINE;
+ ctrl_x_mode = CTRL_X_COMPLETE;
ins_compl_add_list(list);
compl_matches = ins_compl_make_cyclic();