- New window option monitor-content to search for a string in a window, and

highlight the status line if it matches.
- To make this possible, the function cmd_find_window_search from
  cmd-find-window.c had to be moved to window.c and renamed window_pane_search.
- While there use three new functions in server.c to check for bell, activity,
  and content, to avoid too much nesting.
This commit is contained in:
Tiago Cunha
2009-05-19 13:32:55 +00:00
parent a385f75792
commit 80af85a102
11 changed files with 168 additions and 97 deletions

View File

@ -1,4 +1,4 @@
/* $Id: status.c,v 1.81 2009-05-17 18:15:40 nicm Exp $ */
/* $Id: status.c,v 1.82 2009-05-19 13:32:55 tcunha Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@ -184,6 +184,8 @@ draw:
larrow = -1;
else if (session_alert_has(s, wl, WINDOW_BELL))
larrow = -1;
else if (session_alert_has(s, wl, WINDOW_CONTENT))
larrow = -1;
}
for (ptr = text; *ptr != '\0'; ptr++) {
@ -197,6 +199,8 @@ draw:
rarrow = -1;
else if (session_alert_has(s, wl, WINDOW_BELL))
rarrow = -1;
else if (session_alert_has(s, wl, WINDOW_CONTENT))
rarrow = -1;
}
if (offset < start + width) {
@ -470,6 +474,9 @@ status_print(struct session *s, struct winlink *wl, struct grid_cell *gc)
} else if (session_alert_has(s, wl, WINDOW_BELL)) {
flag = '!';
gc->attr ^= GRID_ATTR_REVERSE;
} else if (session_alert_has(s, wl, WINDOW_CONTENT)) {
flag = '+';
gc->attr ^= GRID_ATTR_REVERSE;
}
xasprintf(&text, "%d:%s%c", wl->idx, wl->window->name, flag);