From 7410248abb5bfa2af539c1452561c410a0fc5831 Mon Sep 17 00:00:00 2001 From: toonn Date: Mon, 17 May 2021 18:50:53 +0200 Subject: browsercolumn: Fix regression when clicking preview When clicking the preview column ranger used to open the targeted file. This behavior was broken when implementing preview scrolling. This reenables that behavior when using the right mouse button. I decided to deviate from the original behavior because it's prone to accidentally opening a file when clicking on the terminal window to bring it to the foreground. This should be an acceptable middle ground. Fixes #2330 --- ranger/gui/widgets/browsercolumn.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ranger/gui/widgets/browsercolumn.py b/ranger/gui/widgets/browsercolumn.py index e6f5180f..491a5fa4 100644 --- a/ranger/gui/widgets/browsercolumn.py +++ b/ranger/gui/widgets/browsercolumn.py @@ -99,7 +99,10 @@ class BrowserColumn(Pager): # pylint: disable=too-many-instance-attributes self.fm.thisdir.move_to_obj(clicked_file) self.fm.execute_file(clicked_file) elif self.target.is_file: - self.scrollbit(direction) + if event.pressed(3): + self.fm.execute_file(self.target) + else: + self.scrollbit(direction) else: if self.level > 0 and not direction: self.fm.move(right=0) -- cgit 1.4.1-2-gfad0