Mercurial > vim
diff src/libvterm/include/vterm.h @ 13448:a62b0bbc8834 v8.0.1598
patch 8.0.1598: cannot select text in a terminal with the mouse
commit https://github.com/vim/vim/commit/c48369c3fc507f398abbc933a60f653c6abe6701
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Mar 11 19:30:45 2018 +0100
patch 8.0.1598: cannot select text in a terminal with the mouse
Problem: Cannot select text in a terminal with the mouse.
Solution: When a job in a terminal is not consuming mouse events, use them
for modeless selection. Also stop Insert mode when clicking in a
terminal window.
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Sun, 11 Mar 2018 19:45:05 +0100 |
parents | c5bccd50100e |
children | 9f857e6310b6 |
line wrap: on
line diff
--- a/src/libvterm/include/vterm.h +++ b/src/libvterm/include/vterm.h @@ -259,6 +259,19 @@ typedef struct { int (*setlineinfo)(int row, const VTermLineInfo *newinfo, const VTermLineInfo *oldinfo, void *user); } VTermStateCallbacks; +typedef struct { + VTermPos pos; + int buttons; +#define MOUSE_BUTTON_LEFT 0x01 +#define MOUSE_BUTTON_MIDDLE 0x02 +#define MOUSE_BUTTON_RIGHT 0x04 + int flags; +#define MOUSE_WANT_CLICK 0x01 +#define MOUSE_WANT_DRAG 0x02 +#define MOUSE_WANT_MOVE 0x04 + /* useful to add protocol? */ +} VTermMouseState; + VTermState *vterm_obtain_state(VTerm *vt); void vterm_state_set_callbacks(VTermState *state, const VTermStateCallbacks *callbacks, void *user); @@ -272,6 +285,7 @@ void *vterm_state_get_unrecognised_fbdat void vterm_state_reset(VTermState *state, int hard); void vterm_state_get_cursorpos(const VTermState *state, VTermPos *cursorpos); +void vterm_state_get_mousestate(const VTermState *state, VTermMouseState *mousestate); void vterm_state_get_default_colors(const VTermState *state, VTermColor *default_fg, VTermColor *default_bg); void vterm_state_get_palette_color(const VTermState *state, int index, VTermColor *col); void vterm_state_set_default_colors(VTermState *state, const VTermColor *default_fg, const VTermColor *default_bg);