0
0
mirror of https://github.com/vim/vim.git synced 2025-09-25 03:54:15 -04:00

patch 8.1.0495: :filter only supports some commands

Problem:    :filter only supports some commands.
Solution:   Add :filter support for more commands. (Marcin Szamotulski,
            closes #2856)
This commit is contained in:
Bram Moolenaar
2018-10-25 13:31:37 +02:00
parent babfcf54ae
commit f86db78fed
8 changed files with 76 additions and 4 deletions

View File

@@ -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);