[PATCH] chistedit: use default curses colours

Pulkit Goyal 7895pulkit at gmail.com
Fri Apr 5 10:51:55 EDT 2019


On Thu, Apr 4, 2019 at 6:15 AM Jordi GutiƩrrez Hermoso <jordigh at octave.org>
wrote:

> # HG changeset patch
> # User Jordi GutiƩrrez Hermoso <jordigh at octave.org>
> # Date 1554347266 14400
> #      Wed Apr 03 23:07:46 2019 -0400
> # Node ID 263cec9c08fc1b517847fe53f27b47978be127f4
> # Parent  4ee906aa7b60fb6b113e4dc187fbb5a8f42e557c
> chistedit: use default curses colours
>
> Terminals will define default colours (for example, white text on
> black background), but curses doesn't obey those default colours
> unless told to do so.
>
> Calling `curses.use_default_colors` makes curses obey the default
> terminal colours. One of the most obvious effects is that this allows
> transparency on terminals that support it.
>
> This also brings chistedit closer in appearance to crecord, which also
> uses default colours.
>
> diff --git a/hgext/histedit.py b/hgext/histedit.py
> --- a/hgext/histedit.py
> +++ b/hgext/histedit.py
> @@ -1238,6 +1238,8 @@ def patchcontents(state):
>      return displayer.hunk[rule.ctx.rev()].splitlines()
>
>  def _chisteditmain(repo, rules, stdscr):
> +    curses.use_default_colors()
>

This can raise curses.error. We need to catch that. Related:
https://www.mercurial-scm.org/repo/hg-committed/rev/fb2e59e92651c33918987b9bbf84cedb37ac2557
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.mercurial-scm.org/pipermail/mercurial-devel/attachments/20190405/8e8a0f78/attachment.html>


More information about the Mercurial-devel mailing list