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

[PATCH 1/2] git-gui: support for underline styles

From
Bert Wesarg <bert.wesarg@googlemail.com>
Date
Mar 30, 2011, 06:44 UTC
Message-ID
<2cd6fc8a8da65dc6c2e420d150429b59fdbb3386.1301467146.git.bert.wesarg@googlemail.com>
In-Reply-To
<AANLkTimnX-OJYzSvot-yUMGKXmqJw9deTGS-6mzywoEe@mail.gmail.com>
From: Pat Thoyts <patthoyts@users.sourceforge.net>
From: Pat Thoyts <patthoyts@users.sourceforge.net>
Suggested-by: Bert Wesarg <bert.wesarg@googlemail.com>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>
---

I left underline out because I reckon it would just make text harder to read on a gui display. It seems like the option would only be useful on monochrome terminals.

If we do want to support underlines in the diff view window then we can
have a different tag rather than replicating each color to get a
underlined version of the same color.
Something like the following should do it:
---
 git-gui.sh   |    1 +
 lib/diff.tcl |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/git-gui.sh b/git-gui.sh
index fd6a43d..d5c1535 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -3361,6 +3361,7 @@ foreach {n c} {0 black 1 red4 2 green4 3 yellow4 4 blue4 5 magenta4 6 cyan4 7 gr
 	$ui_diff tag configure clri3$n -background $c
 }
 $ui_diff tag configure clr1 -font font_diffbold
+$ui_diff tag configure clr4 -underline 1
 
 $ui_diff tag conf d_info -foreground blue -font font_diffbold
 
diff --git a/lib/diff.tcl b/lib/diff.tcl
index cf8a95e..39e4d90 100644
--- a/lib/diff.tcl
+++ b/lib/diff.tcl
@@ -504,7 +504,7 @@ proc read_diff {fd conflict_size cont_info} {
 			set prefix clr
 			foreach style [split $colbegin ";"] {
 				if {$style eq "7"} {append prefix i; continue}
-				if {$style < 30 || $style > 47} {continue}
+				if {$style != 4 && ($style < 30 || $style > 47)} {continue}
 				set a "$mark linestart + $posbegin chars"
 				set b "$mark linestart + $posend chars"
 				catch {$ui_diff tag add $prefix$style $a $b}
-- 
1.7.4.1.1319.ga04f7.dirty
Previous: Bert Wesarg
Message 5 of 5 in “git-gui: support for underline styles”
  1. git-gui: support for underline stylesBert Wesarg, Nov 15, 2010
  2. Pat ThoytsNov 19, 2010
  3. Bert WesargNov 19, 2010
  4. Bert WesargFeb 27, 2011
  5. 1/2 git-gui: support for underline stylesBert Wesarg, Mar 30, 2011

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.