mirror of
https://github.com/tmux/tmux.git
synced 2025-01-05 15:28:50 +00:00
Merge branch 'obsd-master' into master
This commit is contained in:
commit
9d80ec6cc9
@ -476,7 +476,7 @@ key_bindings_init(void)
|
||||
"bind -Tcopy-mode C-f send -X cursor-right",
|
||||
"bind -Tcopy-mode C-b send -X cursor-left",
|
||||
"bind -Tcopy-mode C-g send -X clear-selection",
|
||||
"bind -Tcopy-mode C-k send -X copy-end-of-line",
|
||||
"bind -Tcopy-mode C-k send -X copy-end-of-line-and-cancel",
|
||||
"bind -Tcopy-mode C-n send -X cursor-down",
|
||||
"bind -Tcopy-mode C-p send -X cursor-up",
|
||||
"bind -Tcopy-mode C-r command-prompt -T search -ip'(search up)' -I'#{pane_search_string}' 'send -X search-backward-incremental \"%%%\"'",
|
||||
@ -575,7 +575,7 @@ key_bindings_init(void)
|
||||
"bind -Tcopy-mode-vi ? command-prompt -T search -p'(search up)' 'send -X search-backward \"%%%\"'",
|
||||
"bind -Tcopy-mode-vi A send -X append-selection-and-cancel",
|
||||
"bind -Tcopy-mode-vi B send -X previous-space",
|
||||
"bind -Tcopy-mode-vi D send -X copy-end-of-line",
|
||||
"bind -Tcopy-mode-vi D send -X copy-end-of-line-and-cancel",
|
||||
"bind -Tcopy-mode-vi E send -X next-space-end",
|
||||
"bind -Tcopy-mode-vi F command-prompt -1p'(jump backward)' 'send -X jump-backward \"%%%\"'",
|
||||
"bind -Tcopy-mode-vi G send -X history-bottom",
|
||||
|
4
tmux.1
4
tmux.1
@ -1676,8 +1676,10 @@ The following commands are supported in copy mode:
|
||||
.It Li "bottom-line" Ta "L" Ta ""
|
||||
.It Li "cancel" Ta "q" Ta "Escape"
|
||||
.It Li "clear-selection" Ta "Escape" Ta "C-g"
|
||||
.It Li "copy-end-of-line [<prefix>]" Ta "D" Ta "C-k"
|
||||
.It Li "copy-end-of-line [<prefix>]" Ta "" Ta ""
|
||||
.It Li "copy-end-of-line-and-cancel [<prefix>]" Ta "D" Ta "C-k"
|
||||
.It Li "copy-line [<prefix>]" Ta "" Ta ""
|
||||
.It Li "copy-line-and-cancel [<prefix>]" Ta "" Ta ""
|
||||
.It Li "copy-pipe [<command>] [<prefix>]" Ta "" Ta ""
|
||||
.It Li "copy-pipe-no-clear [<command>] [<prefix>]" Ta "" Ta ""
|
||||
.It Li "copy-pipe-and-cancel [<command>] [<prefix>]" Ta "" Ta ""
|
||||
|
@ -960,6 +960,42 @@ window_copy_cmd_clear_selection(struct window_copy_cmd_state *cs)
|
||||
|
||||
static enum window_copy_cmd_action
|
||||
window_copy_cmd_copy_end_of_line(struct window_copy_cmd_state *cs)
|
||||
{
|
||||
struct window_mode_entry *wme = cs->wme;
|
||||
struct client *c = cs->c;
|
||||
struct session *s = cs->s;
|
||||
struct winlink *wl = cs->wl;
|
||||
struct window_pane *wp = wme->wp;
|
||||
u_int np = wme->prefix, ocx, ocy, ooy;
|
||||
struct window_copy_mode_data *data = wme->data;
|
||||
char *prefix = NULL;
|
||||
|
||||
if (cs->args->argc == 2)
|
||||
prefix = format_single(NULL, cs->args->argv[1], c, s, wl, wp);
|
||||
|
||||
ocx = data->cx;
|
||||
ocy = data->cy;
|
||||
ooy = data->oy;
|
||||
|
||||
window_copy_start_selection(wme);
|
||||
for (; np > 1; np--)
|
||||
window_copy_cursor_down(wme, 0);
|
||||
window_copy_cursor_end_of_line(wme);
|
||||
|
||||
if (s != NULL)
|
||||
window_copy_copy_selection(wme, prefix);
|
||||
window_copy_clear_selection(wme);
|
||||
|
||||
data->cx = ocx;
|
||||
data->cy = ocy;
|
||||
data->oy = ooy;
|
||||
|
||||
free(prefix);
|
||||
return (WINDOW_COPY_CMD_REDRAW);
|
||||
}
|
||||
|
||||
static enum window_copy_cmd_action
|
||||
window_copy_cmd_copy_end_of_line_and_cancel(struct window_copy_cmd_state *cs)
|
||||
{
|
||||
struct window_mode_entry *wme = cs->wme;
|
||||
struct client *c = cs->c;
|
||||
@ -990,6 +1026,44 @@ window_copy_cmd_copy_end_of_line(struct window_copy_cmd_state *cs)
|
||||
|
||||
static enum window_copy_cmd_action
|
||||
window_copy_cmd_copy_line(struct window_copy_cmd_state *cs)
|
||||
{
|
||||
struct window_mode_entry *wme = cs->wme;
|
||||
struct client *c = cs->c;
|
||||
struct session *s = cs->s;
|
||||
struct winlink *wl = cs->wl;
|
||||
struct window_pane *wp = wme->wp;
|
||||
struct window_copy_mode_data *data = wme->data;
|
||||
u_int np = wme->prefix, ocx, ocy, ooy;
|
||||
char *prefix = NULL;
|
||||
|
||||
if (cs->args->argc == 2)
|
||||
prefix = format_single(NULL, cs->args->argv[1], c, s, wl, wp);
|
||||
|
||||
ocx = data->cx;
|
||||
ocy = data->cy;
|
||||
ooy = data->oy;
|
||||
|
||||
data->selflag = SEL_CHAR;
|
||||
window_copy_cursor_start_of_line(wme);
|
||||
window_copy_start_selection(wme);
|
||||
for (; np > 1; np--)
|
||||
window_copy_cursor_down(wme, 0);
|
||||
window_copy_cursor_end_of_line(wme);
|
||||
|
||||
if (s != NULL)
|
||||
window_copy_copy_selection(wme, prefix);
|
||||
window_copy_clear_selection(wme);
|
||||
|
||||
data->cx = ocx;
|
||||
data->cy = ocy;
|
||||
data->oy = ooy;
|
||||
|
||||
free(prefix);
|
||||
return (WINDOW_COPY_CMD_REDRAW);
|
||||
}
|
||||
|
||||
static enum window_copy_cmd_action
|
||||
window_copy_cmd_copy_line_and_cancel(struct window_copy_cmd_state *cs)
|
||||
{
|
||||
struct window_mode_entry *wme = cs->wme;
|
||||
struct client *c = cs->c;
|
||||
@ -2264,8 +2338,12 @@ static const struct {
|
||||
window_copy_cmd_clear_selection },
|
||||
{ "copy-end-of-line", 0, 1, WINDOW_COPY_CMD_CLEAR_ALWAYS,
|
||||
window_copy_cmd_copy_end_of_line },
|
||||
{ "copy-end-of-line-and-cancel", 0, 1, WINDOW_COPY_CMD_CLEAR_ALWAYS,
|
||||
window_copy_cmd_copy_end_of_line_and_cancel },
|
||||
{ "copy-line", 0, 1, WINDOW_COPY_CMD_CLEAR_ALWAYS,
|
||||
window_copy_cmd_copy_line },
|
||||
{ "copy-line-and-cancel", 0, 1, WINDOW_COPY_CMD_CLEAR_ALWAYS,
|
||||
window_copy_cmd_copy_line_and_cancel },
|
||||
{ "copy-pipe-no-clear", 0, 2, WINDOW_COPY_CMD_CLEAR_NEVER,
|
||||
window_copy_cmd_copy_pipe_no_clear },
|
||||
{ "copy-pipe", 0, 2, WINDOW_COPY_CMD_CLEAR_ALWAYS,
|
||||
|
Loading…
Reference in New Issue
Block a user