0
0
mirror of https://github.com/vim/vim.git synced 2025-10-12 06:44:06 -04:00

patch 8.1.1221: filtering does not work when listing marks

Problem:    Filtering does not work when listing marks.
Solution:   Implement filtering marks. (Marcin Szamotulski, closes #3895)
This commit is contained in:
Bram Moolenaar
2019-04-27 22:40:08 +02:00
parent 0ee1bdff7d
commit ad6dc49a75
4 changed files with 55 additions and 32 deletions

View File

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