git-gui: add horizontal scrollbar to commit buffer
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> Signed-off-by: Pratyush Yadav <me@yadavpratyush.com>
Bert Wesarg committed
Sep 13, 2019 at 22:16 UTC
da08d559b714016af532594083fe96120b36f58d
1 file changed
+6
git-gui.sh
+6
@@ -3363,10 +3363,16 @@ ttext $ui_comm -background white -foreground black \
3363
-relief sunken \
3364
-width $repo_config(gui.commitmsgwidth) -height 9 -wrap none \
3365
-font font_diff \
3366
+ -xscrollcommand {.vpane.lower.commarea.buffer.frame.sbx set} \
3367
-yscrollcommand {.vpane.lower.commarea.buffer.frame.sby set}
3368
+${NS}::scrollbar .vpane.lower.commarea.buffer.frame.sbx \
3369
+ -orient horizontal \
3370
+ -command [list $ui_comm xview]
3371
${NS}::scrollbar .vpane.lower.commarea.buffer.frame.sby \
3372
+ -orient vertical \
3373
-command [list $ui_comm yview]
3374
3375
+pack .vpane.lower.commarea.buffer.frame.sbx -side bottom -fill x
3376
pack .vpane.lower.commarea.buffer.frame.sby -side right -fill y
3377
pack $ui_comm -side left -fill y
3378
pack .vpane.lower.commarea.buffer.header -side top -fill x