Eg try this:
Index: mode-tree.c
===================================================================
RCS file: /cvs/src/usr.bin/tmux/mode-tree.c,v
retrieving revision 1.20
diff -u -p -r1.20 mode-tree.c
--- mode-tree.c 3 Nov 2017 17:11:20 -0000 1.20
+++ mode-tree.c 23 Jan 2018 07:52:06 -0000
@@ -62,6 +62,7 @@ struct mode_tree_data {
int preview;
char *search;
char *filter;
+ int no_matches;
};
struct mode_tree_item {
@@ -357,7 +358,8 @@ mode_tree_build(struct mode_tree_data *m
TAILQ_INIT(&mtd->children);
mtd->buildcb(mtd->modedata, mtd->sort_type, &tag, mtd->filter);
- if (TAILQ_EMPTY(&mtd->children))
+ mtd->no_matches = TAILQ_EMPTY(&mtd->children);
+ if (mtd->no_matches)
mtd->buildcb(mtd->modedata, mtd->sort_type, &tag, NULL);
mode_tree_free_items(&mtd->saved);
@@ -479,7 +481,7 @@ mode_tree_draw(struct mode_tree_data *mt
u_int w, h, i, j, sy, box_x, box_y;
char *text, *start, key[7];
const char *tag, *symbol;
- size_t size;
+ size_t size, n;
int keylen;
if (mtd->line_size == 0)
@@ -587,11 +589,24 @@ mode_tree_draw(struct mode_tree_data *mt
screen_write_cursormove(&ctx, 0, h);
screen_write_box(&ctx, w, sy - h);
- xasprintf(&text, " %s (sort: %s) ", mti->name,
+ xasprintf(&text, " %s (sort: %s)", mti->name,
mtd->sort_list[mtd->sort_type]);
if (w - 2 >= strlen(text)) {
screen_write_cursormove(&ctx, 1, h);
screen_write_puts(&ctx, &gc0, "%s", text);
+
+ if (mtd->no_matches)
+ n = (sizeof "no matches") - 1;
+ else
+ n = (sizeof "active") - 1;
+ if (mtd->filter != NULL && w - 2 >= strlen(text) + 10 + n + 2) {
+ screen_write_puts(&ctx, &gc0, " (filter: ");
+ if (mtd->no_matches)
+ screen_write_puts(&ctx, &gc, "no matches");
+ else
+ screen_write_puts(&ctx, &gc0, "active");
+ screen_write_puts(&ctx, &gc0, ") ");
+ }
}
free(text);
On Mon, Jan 22, 2018 at 07:19:36AM +0000, Nicholas Marriott wrote:
> It just enters choose-tree with a suitable filter now, if there are no
> matches the filter is ignored.
> On 22 January 2018 at 02:30, Scott ROCHFORD <[email protected]>
> wrote:
>
> Hi tmuxers,
>
> A
>
> Is there an explanation somewhere of the new "find-window" behaviour?A
> It has changed significantly from previous releases, and I don't really
> understand what it's doing.A A A For example, when you search for a
> string that doesn't exist in any currently open windows, it seems to do
> some kind of fuzzy-guess-matching and display lots of irrelevant
> windows.A Are there ways to make it behave more like previous
> versions... i.e. not display the "tree" of sessions and windows, search
> only the current session, and not display anything when it doesn't find
> an exact match?A The -C -N -T options that are available don't seem to
> fulfil any of those exactly.
>
> A
>
> Regards,
>
> Scott
>
> --
> You received this message because you are subscribed to the Google
> Groups "tmux-users" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to [email protected].
> To post to this group, send email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups
"tmux-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send an email to [email protected].
For more options, visit https://groups.google.com/d/optout.