summaryrefslogtreecommitdiff
path: root/src/map.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-09-03 22:08:33 +0200
committerBram Moolenaar <Bram@vim.org>2019-09-03 22:08:33 +0200
commit581ba39aefe837298a9943b04a1dab13a7ec6772 (patch)
tree156f0c8dd74bd6e76c850239f753cbaa17c12924 /src/map.c
parent27da7de7c547dbf983ed7dd901ea59be4e7c9ab2 (diff)
downloadvim-git-581ba39aefe837298a9943b04a1dab13a7ec6772.tar.gz
patch 8.1.1969: popup window filter is used in all modesv8.1.1969
Problem: Popup window filter is used in all modes. Solution: Add the "filtermode" property.
Diffstat (limited to 'src/map.c')
-rw-r--r--src/map.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/src/map.c b/src/map.c
index ac223a9c1..df8cbedb1 100644
--- a/src/map.c
+++ b/src/map.c
@@ -897,20 +897,10 @@ map_clear_int(
}
#if defined(FEAT_EVAL) || defined(PROTO)
-/*
- * Return TRUE if a map exists that has "str" in the rhs for mode "modechars".
- * Recognize termcap codes in "str".
- * Also checks mappings local to the current buffer.
- */
int
-map_to_exists(char_u *str, char_u *modechars, int abbr)
+mode_str2flags(char_u *modechars)
{
int mode = 0;
- char_u *rhs;
- char_u *buf;
- int retval;
-
- rhs = replace_termcodes(str, &buf, FALSE, TRUE, FALSE);
if (vim_strchr(modechars, 'n') != NULL)
mode |= NORMAL;
@@ -929,7 +919,24 @@ map_to_exists(char_u *str, char_u *modechars, int abbr)
if (vim_strchr(modechars, 'c') != NULL)
mode |= CMDLINE;
- retval = map_to_exists_mode(rhs, mode, abbr);
+ return mode;
+}
+
+/*
+ * Return TRUE if a map exists that has "str" in the rhs for mode "modechars".
+ * Recognize termcap codes in "str".
+ * Also checks mappings local to the current buffer.
+ */
+ int
+map_to_exists(char_u *str, char_u *modechars, int abbr)
+{
+ char_u *rhs;
+ char_u *buf;
+ int retval;
+
+ rhs = replace_termcodes(str, &buf, FALSE, TRUE, FALSE);
+
+ retval = map_to_exists_mode(rhs, mode_str2flags(modechars), abbr);
vim_free(buf);
return retval;