# HG changeset patch
# User Jordi Gutiérrez Hermoso <jord...@octave.org>
# Date 1666645456 14400
#      Mon Oct 24 17:04:16 2022 -0400
# Node ID 5287d8898362935f06b482b236ca6ba948c6850d
# Parent  f68d285158b21d7d13c2a70c8db85e83a83ee392
histedit: fix diff colors

I don't know what was up here, but seems like checking for the first
byte isn't the same thing as "startswith", so the colours in chistedit
diffs were broken.

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -1428,11 +1428,11 @@ pgup/K: move patch up, pgdn/J: move patc
         for y in range(0, length):
             line = output[y]
             if diffcolors:
-                if line and line[0] == b'+':
+                if line and line.startswith(b'+'):
                     win.addstr(
                         y, 0, line, curses.color_pair(COLOR_DIFF_ADD_LINE)
                     )
-                elif line and line[0] == b'-':
+                elif line and line.startswith(b'-'):
                     win.addstr(
                         y, 0, line, curses.color_pair(COLOR_DIFF_DEL_LINE)
                     )
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@lists.mercurial-scm.org
https://lists.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to