On Sun, 26 Mar 2017 13:27:57 -0400, Matt Harbison wrote:
> On Sun, 26 Mar 2017 10:35:34 -0400, Yuya Nishihara <y...@tcha.org> wrote:
> > On Sun, 26 Mar 2017 00:41:05 -0400, Matt Harbison wrote:
> >> # HG changeset patch
> >> # User Matt Harbison <matt_harbi...@yahoo.com>
> >> # Date 1490464217 14400
> >> #      Sat Mar 25 13:50:17 2017 -0400
> >> # Node ID a263702b064a5a3ce1ca74b227e8e624e4b05874
> >> # Parent  22533c3af63d5a67d9210596eafd4b99ab9c7904
> >> color: stop mutating the default effects map
> >
> > I re-read the code, and noticed that both _effects and w32effects are  
> > mostly
> > constants. Perhaps we can simply switch them by ui._colormode.
> >
> >   if ui._colormode == 'win32':
> >       activeeffects = w32neffects
> >   else:
> >       activeeffects = _effects
> >   ... embed escape sequences by using activeeffects ...
> 
> Will we get into trouble with each ui instance having a _colormode, but  
> the activeeffects map effectively being global?

Yeah, maybe. But we can select either w32effects or _effects only by
ui._colormode. Unlike ui._styles, effects table is not user configurable,
which probably means we don't have to store a copy of effects in ui.

>  I don't fully understand  
> the purpose of all the separate ui objects.

That wouldn't be practically important for color, but it isn't nice to
mutate globals depending on ui.
_______________________________________________
Mercurial-devel mailing list
Mercurial-devel@mercurial-scm.org
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel

Reply via email to