git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] gitk: Enable mouse horizontal scrolling in diff pane

From
Gabriele Mazzotta <gabriele.mzt@gmail.com>
Date
Nov 15, 2014, 14:05 UTC
Message-ID
<1416060306-4048-1-git-send-email-gabriele.mzt@gmail.com>

Currently it's required to hold Shift and scroll up and down to move horizontally. Listen to Button-6 and Button-7 events too to make horizontal scrolling handier with touchpads and some mice.

Signed-off-by: Gabriele Mazzotta <gabriele.mzt@gmail.com>
---
 gitk-git/gitk | 7 +++++++
 1 file changed, 7 insertions(+)
diff --git a/gitk-git/gitk b/gitk-git/gitk
index 78358a7..95a98e3 100755
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -2516,6 +2516,13 @@ proc makewindow {} {
     } else {
 	bindall <ButtonRelease-4> "allcanvs yview scroll -5 units"
 	bindall <ButtonRelease-5> "allcanvs yview scroll 5 units"
+        bind $ctext <Button> {
+            if {"%b" eq 6} {
+                $ctext xview scroll -5 units
+            } elseif {"%b" eq 7} {
+                $ctext xview scroll 5 units
+            }
+        }
         if {[tk windowingsystem] eq "aqua"} {
             bindall <MouseWheel> {
                 set delta [expr {- (%D)}]
-- 
2.1.3
Next: Stefan Haller
Message 1 of 3 in “gitk: Enable mouse horizontal scrolling in diff pane”
  1. gitk: Enable mouse horizontal scrolling in diff paneGabriele Mazzotta, Nov 15, 2014
  2. Stefan HallerNov 16, 2014
  3. Paul MackerrasMar 22, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.