git-gui: sort the numeric ansi codes
[gitweb.git] / lib / diff.tcl
index cf8a95ec346a9a8afa60a3812d59a8caa4bb4c3f..f5ed5d1dc66844fb58a2605285eb460fe14112a4 100644 (file)
@@ -502,9 +502,9 @@ proc read_diff {fd conflict_size cont_info} {
 
                foreach {posbegin colbegin posend colend} $markup {
                        set prefix clr
-                       foreach style [split $colbegin ";"] {
+                       foreach style [lsort -integer [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}