git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Bert Wesarg <bert.wesarg@googlemail.com>
To: git@vger.kernel.org
Cc: me@yadavpratyush.com,
	Birger Skogeng Pedersen <birger.sp@gmail.com>,
	Bert Wesarg <bert.wesarg@googlemail.com>
Subject: [PATCH 2/2] git-gui: add horizontal scrollbar to commit buffer
Date: Wed,  4 Sep 2019 22:10:23 +0200	[thread overview]
Message-ID: <62ef03a2938ac0d2158b1c3201c7f10e52e30ecb.1567627609.git.bert.wesarg@googlemail.com> (raw)
In-Reply-To: <7da71d89f9fa987eca2e25974e4cec382c146e44.1567627609.git.bert.wesarg@googlemail.com>

While the commit message widget has a configurable fixed width, it
nevertheless allows to write commit messages which exceed this limit.
Though it does not show this content because there is not scrollbar for
this widget. No it is.

There seems to be a bug in at least up to Tcl/Tk 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 | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/git-gui.sh b/git-gui.sh
index a491085..fa9c0d2 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -3363,14 +3363,20 @@ 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 $ui_comm -side left -fill both -expand 1
 pack .vpane.lower.commarea.buffer.header -side top -fill x
-pack .vpane.lower.commarea.buffer.frame -side left -fill y
+pack .vpane.lower.commarea.buffer.frame -side bottom -fill both -expand 1
 pack .vpane.lower.commarea.buffer -side left -fill y
 
 # -- Commit Message Buffer Context Menu
-- 
2.21.0.789.ga095d9d866


  reply	other threads:[~2019-09-04 20:10 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-04 20:10 [PATCH 1/2] git-gui: warn if the commit message contains lines longer than the set limit Bert Wesarg
2019-09-04 20:10 ` Bert Wesarg [this message]
2019-09-04 20:31   ` [PATCH 2/2] git-gui: add horizontal scrollbar to commit buffer Eric Sunshine
2019-09-04 20:46     ` Bert Wesarg
2019-09-10 20:28   ` Pratyush Yadav
2019-09-12 19:10     ` Bert Wesarg
2019-09-04 20:29 ` [PATCH 1/2] git-gui: warn if the commit message contains lines longer than the set limit Eric Sunshine
2019-09-04 20:43   ` Bert Wesarg
2019-09-04 22:48     ` Pratyush Yadav
2019-09-05  6:48       ` Birger Skogeng Pedersen
2019-09-05 17:46         ` Bert Wesarg
2019-09-06 14:08           ` Birger Skogeng Pedersen
2019-09-06 20:07             ` Philip Oakley
2019-09-10  8:04               ` David Aguilar
2019-09-10 19:42                 ` Pratyush Yadav
2019-09-05  6:21     ` Johannes Sixt
2019-09-05 17:43       ` Bert Wesarg
2019-09-10 16:50 ` Johannes Sixt
2019-09-12 19:26   ` Bert Wesarg
2019-09-10 20:34 ` Pratyush Yadav
2019-09-12 19:13   ` Bert Wesarg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=62ef03a2938ac0d2158b1c3201c7f10e52e30ecb.1567627609.git.bert.wesarg@googlemail.com \
    --to=bert.wesarg@googlemail.com \
    --cc=birger.sp@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=me@yadavpratyush.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).