selection: only disable selection when mouse drag/motion is on

This allows us to select text in e.g. man/less while still being able
to use LESS=--MOUSE (i.e. enable scrolling with mouse).
This commit is contained in:
Daniel Eklöf 2019-08-04 19:15:50 +02:00
parent 42fdb3653d
commit 3ae210d4c5
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

View file

@ -20,7 +20,8 @@
static bool
selection_enabled(const struct terminal *term)
{
return term->mouse_tracking == MOUSE_NONE;
return (term->mouse_tracking != MOUSE_DRAG &&
term->mouse_tracking != MOUSE_MOTION);
}
static char *