about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authortoonn <toonn@toonn.io>2021-05-17 18:50:53 +0200
committertoonn <toonn@toonn.io>2021-05-17 19:16:08 +0200
commit7410248abb5bfa2af539c1452561c410a0fc5831 (patch)
tree17805454be5dd5185dfd2e32957799c568b1fa48
parent741929906fbfb58e57e85ff58356ab1eafab3899 (diff)
downloadranger-7410248abb5bfa2af539c1452561c410a0fc5831.tar.gz
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
-rw-r--r--ranger/gui/widgets/browsercolumn.py5
1 files changed, 4 insertions, 1 deletions
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)