mirror of
https://github.com/tmux/tmux.git
synced 2025-01-07 16:28:48 +00:00
Need to increment the argument to skip the prefix earlier, fixes
repeated incremental search in copy mode, reported by Kaushal Modi in GitHub issue 1780.
This commit is contained in:
parent
4ca1de1b8b
commit
09e90c1645
@ -1668,9 +1668,11 @@ window_copy_cmd_search_backward_incremental(struct window_copy_cmd_state *cs)
|
|||||||
struct window_mode_entry *wme = cs->wme;
|
struct window_mode_entry *wme = cs->wme;
|
||||||
struct window_copy_mode_data *data = wme->data;
|
struct window_copy_mode_data *data = wme->data;
|
||||||
const char *argument = cs->args->argv[1];
|
const char *argument = cs->args->argv[1];
|
||||||
enum window_copy_cmd_action action = WINDOW_COPY_CMD_NOTHING;
|
|
||||||
const char *ss = data->searchstr;
|
const char *ss = data->searchstr;
|
||||||
|
char prefix;
|
||||||
|
enum window_copy_cmd_action action = WINDOW_COPY_CMD_NOTHING;
|
||||||
|
|
||||||
|
prefix = *argument++;
|
||||||
if (data->searchx == -1 || data->searchy == -1) {
|
if (data->searchx == -1 || data->searchy == -1) {
|
||||||
data->searchx = data->cx;
|
data->searchx = data->cx;
|
||||||
data->searchy = data->cy;
|
data->searchy = data->cy;
|
||||||
@ -1681,13 +1683,11 @@ window_copy_cmd_search_backward_incremental(struct window_copy_cmd_state *cs)
|
|||||||
data->oy = data->searcho;
|
data->oy = data->searcho;
|
||||||
action = WINDOW_COPY_CMD_REDRAW;
|
action = WINDOW_COPY_CMD_REDRAW;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*argument == '\0') {
|
if (*argument == '\0') {
|
||||||
window_copy_clear_marks(wme);
|
window_copy_clear_marks(wme);
|
||||||
return (WINDOW_COPY_CMD_REDRAW);
|
return (WINDOW_COPY_CMD_REDRAW);
|
||||||
}
|
}
|
||||||
|
switch (prefix) {
|
||||||
switch (*argument++) {
|
|
||||||
case '=':
|
case '=':
|
||||||
case '-':
|
case '-':
|
||||||
data->searchtype = WINDOW_COPY_SEARCHUP;
|
data->searchtype = WINDOW_COPY_SEARCHUP;
|
||||||
@ -1717,9 +1717,11 @@ window_copy_cmd_search_forward_incremental(struct window_copy_cmd_state *cs)
|
|||||||
struct window_mode_entry *wme = cs->wme;
|
struct window_mode_entry *wme = cs->wme;
|
||||||
struct window_copy_mode_data *data = wme->data;
|
struct window_copy_mode_data *data = wme->data;
|
||||||
const char *argument = cs->args->argv[1];
|
const char *argument = cs->args->argv[1];
|
||||||
enum window_copy_cmd_action action = WINDOW_COPY_CMD_NOTHING;
|
|
||||||
const char *ss = data->searchstr;
|
const char *ss = data->searchstr;
|
||||||
|
char prefix;
|
||||||
|
enum window_copy_cmd_action action = WINDOW_COPY_CMD_NOTHING;
|
||||||
|
|
||||||
|
prefix = *argument++;
|
||||||
if (data->searchx == -1 || data->searchy == -1) {
|
if (data->searchx == -1 || data->searchy == -1) {
|
||||||
data->searchx = data->cx;
|
data->searchx = data->cx;
|
||||||
data->searchy = data->cy;
|
data->searchy = data->cy;
|
||||||
@ -1730,13 +1732,11 @@ window_copy_cmd_search_forward_incremental(struct window_copy_cmd_state *cs)
|
|||||||
data->oy = data->searcho;
|
data->oy = data->searcho;
|
||||||
action = WINDOW_COPY_CMD_REDRAW;
|
action = WINDOW_COPY_CMD_REDRAW;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (*argument == '\0') {
|
if (*argument == '\0') {
|
||||||
window_copy_clear_marks(wme);
|
window_copy_clear_marks(wme);
|
||||||
return (WINDOW_COPY_CMD_REDRAW);
|
return (WINDOW_COPY_CMD_REDRAW);
|
||||||
}
|
}
|
||||||
|
switch (prefix) {
|
||||||
switch (*argument++) {
|
|
||||||
case '=':
|
case '=':
|
||||||
case '+':
|
case '+':
|
||||||
data->searchtype = WINDOW_COPY_SEARCHDOWN;
|
data->searchtype = WINDOW_COPY_SEARCHDOWN;
|
||||||
|
Loading…
Reference in New Issue
Block a user