aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorGuldoman <giulio.lettieri@gmail.com>2021-09-14 18:26:49 +0200
committerGuldoman <giulio.lettieri@gmail.com>2021-09-14 18:26:49 +0200
commite17fee65fcda4ffefb36cb6df1d7ce83ca77d1f3 (patch)
tree397154e57383358289e2d718c9b58d45e42b2ba6 /plugins
parente47539e9b5d00e564cb9685a0eff56ca421d975b (diff)
downloadlite-xl-plugins-e17fee65fcda4ffefb36cb6df1d7ce83ca77d1f3.tar.gz
lite-xl-plugins-e17fee65fcda4ffefb36cb6df1d7ce83ca77d1f3.zip
`dragdropselected`: Allow scrollbar dragging when there is a selection
When dragging the scrollbar from the same vertical position of a line in a selection, we would ignore the scrollbar drag and instead drag the selection.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/dragdropselected.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/dragdropselected.lua b/plugins/dragdropselected.lua
index a26a82c..6bdb101 100644
--- a/plugins/dragdropselected.lua
+++ b/plugins/dragdropselected.lua
@@ -78,6 +78,10 @@ end -- DocView:on_mouse_moved
-- override DocView:on_mouse_pressed
local on_mouse_pressed = DocView.on_mouse_pressed
function DocView:on_mouse_pressed(button, x, y, clicks)
+ local caught = DocView.super.on_mouse_pressed(self, button, x, y, clicks)
+ if caught then
+ return caught
+ end
-- no need to proceed if not left button or has no selection
if ('left' ~= button)
or (not self.doc:has_selection())