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

[PATCH v4] git-gui: add horizontal scrollbar to commit buffer

From
Bert Wesarg <bert.wesarg@googlemail.com>
Date
Sep 13, 2019, 20:16 UTC
Message-ID
<20b0d8599099a412833af93f85e414fdc495dd76.1568405611.git.bert.wesarg@googlemail.com>

While the commit message widget has a configurable fixed width, it nevertheless allowed to write commit messages which exceeded this limit. Though there is no visual clue, that there is scrolling going on. Now there is a horizontal scrollbar.

There seems to be a bug in at least Tcl/Tk up to version 8.6.8, which does not update the horizontal scrollbar if one removes the whole content at once.

Suggested-by: Birger Skogeng Pedersen <birger.sp@gmail.com>
Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
---
 git-gui.sh | 6 ++++++
 1 file changed, 6 insertions(+)
diff --git a/git-gui.sh b/git-gui.sh
index 5bc21b8..ad962d4 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -3363,10 +3363,16 @@ ttext $ui_comm -background white -foreground black \
 	-relief sunken \
 	-width $repo_config(gui.commitmsgwidth) -height 9 -wrap none \
 	-font font_diff \
+	-xscrollcommand {.vpane.lower.commarea.buffer.frame.sbx set} \
 	-yscrollcommand {.vpane.lower.commarea.buffer.frame.sby set}
+${NS}::scrollbar .vpane.lower.commarea.buffer.frame.sbx \
+	-orient horizontal \
+	-command [list $ui_comm xview]
 ${NS}::scrollbar .vpane.lower.commarea.buffer.frame.sby \
+	-orient vertical \
 	-command [list $ui_comm yview]
 
+pack .vpane.lower.commarea.buffer.frame.sbx -side bottom -fill x
 pack .vpane.lower.commarea.buffer.frame.sby -side right -fill y
 pack $ui_comm -side left -fill y
 pack .vpane.lower.commarea.buffer.header -side top -fill x
-- 
2.21.0.789.ga095d9d866
Next: Pratyush Yadav
Message 1 of 2 in “git-gui: add horizontal scrollbar to commit buffer”
  1. git-gui: add horizontal scrollbar to commit bufferBert Wesarg, Sep 13, 2019
  2. Pratyush YadavSep 13, 2019

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.