chistedit: use magenta for current line as in crecord (issue6071)
authorJordi Gutiérrez Hermoso <jordigh@octave.org>
Wed, 13 Feb 2019 16:58:24 -0500
changeset 41702 a22321f2b1ee
parent 41701 df1f3ba56157
child 41703 47c4ac5035a6
chistedit: use magenta for current line as in crecord (issue6071) It was inconsistent in the UI to have different way to show the current line.
hgext/histedit.py
--- a/hgext/histedit.py	Thu Feb 14 20:57:26 2019 +0530
+++ b/hgext/histedit.py	Wed Feb 13 16:58:24 2019 -0500
@@ -957,7 +957,7 @@
     'roll': '^roll',
 }
 
-COLOR_HELP, COLOR_SELECTED, COLOR_OK, COLOR_WARN  = 1, 2, 3, 4
+COLOR_HELP, COLOR_SELECTED, COLOR_OK, COLOR_WARN, COLOR_CURRENT  = 1, 2, 3, 4, 5
 
 E_QUIT, E_HISTEDIT = 1, 2
 E_PAGEDOWN, E_PAGEUP, E_LINEUP, E_LINEDOWN, E_RESIZE = 3, 4, 5, 6, 7
@@ -1237,6 +1237,7 @@
     curses.init_pair(COLOR_SELECTED, curses.COLOR_BLACK, curses.COLOR_WHITE)
     curses.init_pair(COLOR_WARN, curses.COLOR_BLACK, curses.COLOR_YELLOW)
     curses.init_pair(COLOR_OK, curses.COLOR_BLACK, curses.COLOR_GREEN)
+    curses.init_pair(COLOR_CURRENT, curses.COLOR_WHITE, curses.COLOR_MAGENTA)
 
     # don't display the cursor
     try:
@@ -1327,7 +1328,8 @@
             if y + start == selected:
                 addln(rulesscr, y, 2, rule, curses.color_pair(COLOR_SELECTED))
             elif y + start == pos:
-                addln(rulesscr, y, 2, rule, curses.A_BOLD)
+                addln(rulesscr, y, 2, rule,
+                      curses.color_pair(COLOR_CURRENT) | curses.A_BOLD)
             else:
                 addln(rulesscr, y, 2, rule)
         rulesscr.noutrefresh()