summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2020-12-28 12:01:21 +0000
committerThomas Adam <thomas@xteddy.org>2020-12-28 12:01:21 +0000
commit3cbe186efb93980959e410162c1583a3b54a8417 (patch)
tree624677812a1be17ffc72241465fca81b21cadaa4
parentd936fde7ef62863fbb8b142c3ee229cb460dbfdb (diff)
parenta98ee00dd988b813b0b0cba1af939978505936b7 (diff)
Merge branch 'obsd-master' into master
-rw-r--r--cmd-show-options.c12
-rw-r--r--window-copy.c23
2 files changed, 14 insertions, 21 deletions
diff --git a/cmd-show-options.c b/cmd-show-options.c
index ed93311a..e3ba821d 100644
--- a/cmd-show-options.c
+++ b/cmd-show-options.c
@@ -200,11 +200,13 @@ cmd_show_options_all(struct cmd *self, struct cmdq_item *item, int scope,
u_int idx;
int parent;
- o = options_first(oo);
- while (o != NULL) {
- if (options_table_entry(o) == NULL)
- cmd_show_options_print(self, item, o, -1, 0);
- o = options_next(o);
+ if (cmd_get_entry(self) != &cmd_show_hooks_entry) {
+ o = options_first(oo);
+ while (o != NULL) {
+ if (options_table_entry(o) == NULL)
+ cmd_show_options_print(self, item, o, -1, 0);
+ o = options_next(o);
+ }
}
for (oe = options_table; oe->name != NULL; oe++) {
if (~oe->scope & scope)
diff --git a/window-copy.c b/window-copy.c
index 764f6b5b..d6af397f 100644
--- a/window-copy.c
+++ b/window-copy.c
@@ -272,7 +272,7 @@ struct window_copy_mode_data {
u_char *searchmark;
int searchcount;
int searchmore;
- int searchthis;
+ int searchall;
int searchx;
int searchy;
int searcho;
@@ -396,6 +396,7 @@ window_copy_common_init(struct window_mode_entry *wme)
data->searchstr = NULL;
}
data->searchx = data->searchy = data->searcho = -1;
+ data->searchall = 1;
data->jumptype = WINDOW_COPY_OFF;
data->jumpchar = '\0';
@@ -2334,9 +2335,6 @@ window_copy_command(struct window_mode_entry *wme, struct client *c,
if (clear != WINDOW_COPY_CMD_CLEAR_NEVER) {
window_copy_clear_marks(wme);
data->searchx = data->searchy = -1;
- } else if (data->searchthis != -1) {
- data->searchthis = -1;
- action = WINDOW_COPY_CMD_REDRAW;
}
if (action == WINDOW_COPY_CMD_NOTHING)
action = WINDOW_COPY_CMD_REDRAW;
@@ -2929,9 +2927,11 @@ window_copy_search(struct window_mode_entry *wme, int direction, int regex,
if (data->timeout)
return (0);
- if (wp->searchstr == NULL || wp->searchregex != regex)
+ if (data->searchall || wp->searchstr == NULL ||
+ wp->searchregex != regex) {
visible_only = 0;
- else
+ data->searchall = 0;
+ } else
visible_only = (strcmp(wp->searchstr, str) == 0);
free(wp->searchstr);
wp->searchstr = xstrdup(str);
@@ -3116,7 +3116,6 @@ again:
if (!visible_only) {
if (stopped) {
- data->searchthis = -1;
if (nfound > 1000)
data->searchcount = 1000;
else if (nfound > 100)
@@ -3127,10 +3126,6 @@ again:
data->searchcount = -1;
data->searchmore = 1;
} else {
- if (which != -1)
- data->searchthis = 1 + nfound - which;
- else
- data->searchthis = -1;
data->searchcount = nfound;
data->searchmore = 0;
}
@@ -3366,15 +3361,11 @@ window_copy_write_line(struct window_mode_entry *wme,
if (data->searchcount == -1) {
size = xsnprintf(hdr, sizeof hdr,
"[%u/%u]", data->oy, hsize);
- } else if (data->searchthis == -1) {
+ } else {
size = xsnprintf(hdr, sizeof hdr,
"(%d%s results) [%u/%u]", data->searchcount,
data->searchmore ? "+" : "", data->oy,
hsize);
- } else {
- size = xsnprintf(hdr, sizeof hdr,
- "(%d/%d results) [%u/%u]", data->searchthis,
- data->searchcount, data->oy, hsize);
}
}
if (size > screen_size_x(s))