summaryrefslogtreecommitdiffstats
path: root/src/eval.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2018-10-25 13:31:37 +0200
committerBram Moolenaar <Bram@vim.org>2018-10-25 13:31:37 +0200
commitf86db78fed78541cefdb706e4779ce5ae9ca7820 (patch)
tree89b16ab5d0a2847b75bbe3c4ae782a0a03d6626f /src/eval.c
parentbabfcf54ae9bf9570eddf4958a553635cd589e21 (diff)
patch 8.1.0495: :filter only supports some commandsv8.1.0495
Problem: :filter only supports some commands. Solution: Add :filter support for more commands. (Marcin Szamotulski, closes #2856)
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/eval.c b/src/eval.c
index e70bfd8ab3..4a3cf99124 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -1425,6 +1425,7 @@ list_hashtable_vars(
hashitem_T *hi;
dictitem_T *di;
int todo;
+ char_u buf[IOSIZE];
todo = (int)ht->ht_used;
for (hi = ht->ht_array; todo > 0 && !got_int; ++hi)
@@ -1433,6 +1434,13 @@ list_hashtable_vars(
{
--todo;
di = HI2DI(hi);
+
+ // apply :filter /pat/ to variable name
+ vim_strncpy((char_u *) buf, prefix, IOSIZE - 1);
+ vim_strcat((char_u *) buf, di->di_key, IOSIZE);
+ if (message_filtered(buf))
+ continue;
+
if (empty || di->di_tv.v_type != VAR_STRING
|| di->di_tv.vval.v_string != NULL)
list_one_var(di, prefix, first);