Patchwork [2,of,3] histedit: define new colour pairs for roll action

login
register
mail settings
Submitter Jordi Gutiérrez Hermoso
Date Nov. 7, 2019, 8:31 p.m.
Message ID <47446180a5ee16af1c90.1573158707@chloe>
Download mbox | patch
Permalink /patch/42905/
State New
Headers show

Comments

Jordi Gutiérrez Hermoso - Nov. 7, 2019, 8:31 p.m.
# HG changeset patch
# User Jordi Gutiérrez Hermoso <jordigh@octave.org>
# Date 1572478497 14400
#      Wed Oct 30 19:34:57 2019 -0400
# Node ID 47446180a5ee16af1c90bb20a8dca92fa9d5f794
# Parent  45aea2365bcb5f89d20bb1907d75175246da3d05
histedit: define new colour pairs for roll action

Red seems like a good colour to indicate removal, since that's the
colour we use in diffs. We need three varieties with three different
backgrounds corresponding to the possible ways we can display a rule.

Patch

diff --git a/hgext/histedit.py b/hgext/histedit.py
--- a/hgext/histedit.py
+++ b/hgext/histedit.py
@@ -1056,6 +1056,7 @@  ACTION_LABELS = {
 
 COLOR_HELP, COLOR_SELECTED, COLOR_OK, COLOR_WARN, COLOR_CURRENT = 1, 2, 3, 4, 5
 COLOR_DIFF_ADD_LINE, COLOR_DIFF_DEL_LINE, COLOR_DIFF_OFFSET = 6, 7, 8
+COLOR_ROLL, COLOR_ROLL_CURRENT, COLOR_ROLL_SELECTED = 9, 10, 11
 
 E_QUIT, E_HISTEDIT = 1, 2
 E_PAGEDOWN, E_PAGEUP, E_LINEUP, E_LINEDOWN, E_RESIZE = 3, 4, 5, 6, 7
@@ -1392,6 +1393,9 @@  def _chisteditmain(repo, rules, stdscr):
     curses.init_pair(COLOR_DIFF_ADD_LINE, curses.COLOR_GREEN, -1)
     curses.init_pair(COLOR_DIFF_DEL_LINE, curses.COLOR_RED, -1)
     curses.init_pair(COLOR_DIFF_OFFSET, curses.COLOR_MAGENTA, -1)
+    curses.init_pair(COLOR_ROLL, curses.COLOR_RED, -1)
+    curses.init_pair(COLOR_ROLL_CURRENT, curses.COLOR_BLACK, curses.COLOR_MAGENTA)
+    curses.init_pair(COLOR_ROLL_SELECTED, curses.COLOR_RED, curses.COLOR_WHITE)
 
     # don't display the cursor
     try: