diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-04-27 22:40:08 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-04-27 22:40:08 +0200 |
commit | ad6dc49a7564a99fca36c1928e3865787d3bd5b2 (patch) | |
tree | 11ada58be7c19a0e612e899fc22b3526371aca68 /src/mark.c | |
parent | 0ee1bdff7d34df5fb764a2af15594f9da34a47cc (diff) |
patch 8.1.1221: filtering does not work when listing marksv8.1.1221
Problem: Filtering does not work when listing marks.
Solution: Implement filtering marks. (Marcin Szamotulski, closes #3895)
Diffstat (limited to 'src/mark.c')
-rw-r--r-- | src/mark.c | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/src/mark.c b/src/mark.c index 6a7ab00d8b..1b34c20895 100644 --- a/src/mark.c +++ b/src/mark.c @@ -744,11 +744,12 @@ show_one_mark( int c, char_u *arg, pos_T *p, - char_u *name, + char_u *name_arg, int current) /* in current file */ { static int did_title = FALSE; int mustfree = FALSE; + char_u *name = name_arg; if (c == -1) /* finish up */ { @@ -762,35 +763,38 @@ show_one_mark( semsg(_("E283: No marks matching \"%s\""), arg); } } - /* don't output anything if 'q' typed at --more-- prompt */ + // don't output anything if 'q' typed at --more-- prompt else if (!got_int && (arg == NULL || vim_strchr(arg, c) != NULL) && p->lnum != 0) { - if (!did_title) + if (name == NULL && current) { - /* Highlight title */ - msg_puts_title(_("\nmark line col file/text")); - did_title = TRUE; + name = mark_line(p, 15); + mustfree = TRUE; } - msg_putchar('\n'); - if (!got_int) + if (!message_filtered(name)) { - sprintf((char *)IObuff, " %c %6ld %4d ", c, p->lnum, p->col); - msg_outtrans(IObuff); - if (name == NULL && current) + if (!did_title) { - name = mark_line(p, 15); - mustfree = TRUE; + // Highlight title + msg_puts_title(_("\nmark line col file/text")); + did_title = TRUE; } - if (name != NULL) + msg_putchar('\n'); + if (!got_int) { - msg_outtrans_attr(name, current ? HL_ATTR(HLF_D) : 0); - if (mustfree) - vim_free(name); + sprintf((char *)IObuff, " %c %6ld %4d ", c, p->lnum, p->col); + msg_outtrans(IObuff); + if (name != NULL) + { + msg_outtrans_attr(name, current ? HL_ATTR(HLF_D) : 0); + } } + out_flush(); // show one line at a time } - out_flush(); /* show one line at a time */ + if (mustfree) + vim_free(name); } } |