Hi Bram,
On Wed, Nov 11, 2020 at 11:36 AM Bram Moolenaar <[email protected]>
wrote:
> Also in map.txt: "they must be followed by in the +{lhs} of the mapping
> definition." should be {rhs}.
>
I have changed this.
> It looks like this isn't checked at the time when the map is defined.
> It also makes me wonder if must always come at the start of the {rhs}.
> What could come before this that makes sense?
> And if it must always end in we could just check for it. Or could there be
> something following after the ?
>
You can use a map like the following:
noremap <F3> aHello<Cmd>let x = 10<CR>World
When the <F3> key is pressed, it will insert the text, execute the command
and
then continue inserting the rest of the text. So keys can be specified
before
the <Cmd> pseudo key and after the <CR> at the end of the command.
In ex_getln.c a nested "if" is not needed, can use one "if" with "&&".
>
>
> I have changed this.
BTW, I didn't port the following changes in edit.c from Neovim (as the
insert-mode completion code has changed). These changes were made as part of
the "api: select items in popupmenu" commit to Neovim. But all the new
tests for
the <Cmd> key are passing without these changes. So I don't know the impact
of
these missing changes on insert mode completion.
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index 90da6c8ab..5d918d8f6 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -4406,6 +4443,9 @@ void ins_compl_check_keys(int frequency, int
in_compl_func)
*/
static int ins_compl_key2dir(int c)
{
+ if (c == K_EVENT || c == K_COMMAND) {
+ return pum_want.item < pum_selected_item ? BACKWARD : FORWARD;
+ }
if (c == Ctrl_P || c == Ctrl_L
|| c == K_PAGEUP || c == K_KPAGEUP
|| c == K_S_UP || c == K_UP) {
@@ -4433,6 +4473,11 @@ static int ins_compl_key2count(int c)
{
int h;
+ if (c == K_EVENT || c == K_COMMAND) {
+ int offset = pum_want.item - pum_selected_item;
+ return abs(offset);
+ }
+
if (ins_compl_pum_key(c) && c != K_UP && c != K_DOWN) {
h = pum_get_height();
if (h > 3)
@@ -4459,6 +4504,9 @@ static bool ins_compl_use_match(int c)
case K_KPAGEUP:
case K_S_UP:
return false;
+ case K_EVENT:
+ case K_COMMAND:
+ return pum_want.active && pum_want.insert;
}
return true;
}
Regards,
Yegappan
--
--
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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/CAAW7x7kjXrqKT4_Vw%2BsyYsnudwj0ZoEk%2B_iiuqifC7h6e8JzWQ%40mail.gmail.com.