Make the selection able to exist independent of the cursor position, so

that it is not affected by scrolling. If MouseDragEnd1Pane is bound to
the new "stop-selection" command:

    bind -Tcopy-mode MouseDragEnd1Pane stop-selection

A selection made with the mouse will stay as it is after button 1 is
released. (It also works bound to a key.)

From Artem Fokin.
This commit is contained in:
nicm
2016-11-24 13:38:44 +00:00
parent 6de466cf8b
commit 7e6c2cb238
4 changed files with 162 additions and 50 deletions

3
tmux.h
View File

@@ -681,6 +681,8 @@ LIST_HEAD(joblist, job);
/* Screen selection. */
struct screen_sel {
int flag;
int hidden;
int rectflag;
enum {
LINE_SEL_NONE,
@@ -2055,6 +2057,7 @@ void screen_resize(struct screen *, u_int, u_int, int);
void screen_set_selection(struct screen *,
u_int, u_int, u_int, u_int, u_int, struct grid_cell *);
void screen_clear_selection(struct screen *);
void screen_hide_selection(struct screen *);
int screen_check_selection(struct screen *, u_int, u_int);
void screen_select_cell(struct screen *, struct grid_cell *,
const struct grid_cell *);