git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Clemens Buchacher <drizzd@aon.at>
To: "Shawn O. Pearce" <spearce@spearce.org>
Cc: git@vger.kernel.org
Subject: [PATCH] git gui: visually wrap lines of commit message
Date: Sat, 9 Aug 2008 18:05:57 +0200	[thread overview]
Message-ID: <20080809160557.GA902@localhost> (raw)

Visually wrap lines in the commit message text box. That way we can avoid
a horizontal scroll bar (which was not available anyways).

Note: This does _not_ break lines in the actual commit message.

Signed-off-by: Clemens Buchacher <drizzd@aon.at>
---

I also tried to get automatic line breaks but was unable to do so. I managed
to implement a callback function triggered by the <<Modified>> event, and I
also managed to query the end position of the insertion using the 'insert'
index. So with this information it would be possible to implement automatic
line breaks. Unfortunately, this is not enough for pasting. If there is more
than one new character, the start position of the insertion is unknown.

I then tried to track cursor movement, but no luck there either. Any ideas
are welcome. For now I'll simply have to "git commit --amend<CR>gqG:x<CR>"
each time I use git gui.

Clemens

 git-gui/git-gui.sh |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index 14b2d9a..3949f7d 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -2528,6 +2528,7 @@ text $ui_comm -background white -foreground black \
 	-autoseparators true \
 	-relief sunken \
 	-width $repo_config(gui.commitmsgwidth) -height 9 -wrap none \
+	-wrap char \
 	-font font_diff \
 	-yscrollcommand {.vpane.lower.commarea.buffer.sby set}
 scrollbar .vpane.lower.commarea.buffer.sby \
-- 
1.5.6.4

             reply	other threads:[~2008-08-09 16:21 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-09 16:05 Clemens Buchacher [this message]
2008-08-09 21:44 ` [PATCH] git gui: visually wrap lines of commit message Johannes Sixt
2008-08-09 22:06   ` Clemens Buchacher
2008-08-09 22:14     ` Johannes Sixt
2008-08-09 22:41       ` Clemens Buchacher
2008-08-10  2:25         ` Shawn O. Pearce
2008-08-10  7:56           ` Lars Noschinski
2008-08-10  7:59             ` Shawn O. Pearce
2008-08-10  9:25               ` Clemens Buchacher

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

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

  git send-email \
    --in-reply-to=20080809160557.GA902@localhost \
    --to=drizzd@aon.at \
    --cc=git@vger.kernel.org \
    --cc=spearce@spearce.org \
    /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.
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 NNTP newsgroup(s).