mirror of
https://github.com/tmux/tmux.git
synced 2026-03-06 15:55:33 +00:00
Add commands to turn exit on scroll on, off, toggle. From xcdnlgd at
hotmail dot com in GitHub issue 4884.
This commit is contained in:
@@ -2127,6 +2127,36 @@ window_copy_cmd_rectangle_toggle(struct window_copy_cmd_state *cs)
|
|||||||
return (WINDOW_COPY_CMD_NOTHING);
|
return (WINDOW_COPY_CMD_NOTHING);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static enum window_copy_cmd_action
|
||||||
|
window_copy_cmd_scroll_exit_on(struct window_copy_cmd_state *cs)
|
||||||
|
{
|
||||||
|
struct window_copy_mode_data *data = cs->wme->data;
|
||||||
|
|
||||||
|
data->scroll_exit = 1;
|
||||||
|
|
||||||
|
return (WINDOW_COPY_CMD_NOTHING);
|
||||||
|
}
|
||||||
|
|
||||||
|
static enum window_copy_cmd_action
|
||||||
|
window_copy_cmd_scroll_exit_off(struct window_copy_cmd_state *cs)
|
||||||
|
{
|
||||||
|
struct window_copy_mode_data *data = cs->wme->data;
|
||||||
|
|
||||||
|
data->scroll_exit = 0;
|
||||||
|
|
||||||
|
return (WINDOW_COPY_CMD_NOTHING);
|
||||||
|
}
|
||||||
|
|
||||||
|
static enum window_copy_cmd_action
|
||||||
|
window_copy_cmd_scroll_exit_toggle(struct window_copy_cmd_state *cs)
|
||||||
|
{
|
||||||
|
struct window_copy_mode_data *data = cs->wme->data;
|
||||||
|
|
||||||
|
data->scroll_exit = !data->scroll_exit;
|
||||||
|
|
||||||
|
return (WINDOW_COPY_CMD_NOTHING);
|
||||||
|
}
|
||||||
|
|
||||||
static enum window_copy_cmd_action
|
static enum window_copy_cmd_action
|
||||||
window_copy_cmd_scroll_down(struct window_copy_cmd_state *cs)
|
window_copy_cmd_scroll_down(struct window_copy_cmd_state *cs)
|
||||||
{
|
{
|
||||||
@@ -3073,6 +3103,21 @@ static const struct {
|
|||||||
.clear = WINDOW_COPY_CMD_CLEAR_ALWAYS,
|
.clear = WINDOW_COPY_CMD_CLEAR_ALWAYS,
|
||||||
.f = window_copy_cmd_scroll_down_and_cancel
|
.f = window_copy_cmd_scroll_down_and_cancel
|
||||||
},
|
},
|
||||||
|
{ .command = "scroll-exit-on",
|
||||||
|
.args = { "", 0, 0, NULL },
|
||||||
|
.clear = WINDOW_COPY_CMD_CLEAR_ALWAYS,
|
||||||
|
.f = window_copy_cmd_scroll_exit_on
|
||||||
|
},
|
||||||
|
{ .command = "scroll-exit-off",
|
||||||
|
.args = { "", 0, 0, NULL },
|
||||||
|
.clear = WINDOW_COPY_CMD_CLEAR_ALWAYS,
|
||||||
|
.f = window_copy_cmd_scroll_exit_off
|
||||||
|
},
|
||||||
|
{ .command = "scroll-exit-toggle",
|
||||||
|
.args = { "", 0, 0, NULL },
|
||||||
|
.clear = WINDOW_COPY_CMD_CLEAR_ALWAYS,
|
||||||
|
.f = window_copy_cmd_scroll_exit_toggle
|
||||||
|
},
|
||||||
{ .command = "scroll-middle",
|
{ .command = "scroll-middle",
|
||||||
.args = { "", 0, 0, NULL },
|
.args = { "", 0, 0, NULL },
|
||||||
.clear = WINDOW_COPY_CMD_CLEAR_ALWAYS,
|
.clear = WINDOW_COPY_CMD_CLEAR_ALWAYS,
|
||||||
|
|||||||
Reference in New Issue
Block a user