nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Nano-devel] streamlining a bit of syntax coloring


From: Benno Schulenberg
Subject: Re: [Nano-devel] streamlining a bit of syntax coloring
Date: Thu, 14 Jul 2016 19:35:11 +0200

Hello Rishabh,

On Thu, Jul 14, 2016, at 14:54, Rishabh Dave wrote:
> On Tue, Jul 12, 2016 at 1:53 PM, Benno Schulenberg <address@hidden> wrote:
> > just this is needed:
> >
> >            wattron(edit, varnish->attributes);
> > [...]
> >            wattroff(edit, varnish->attributes);
> 
> 
> I have reduced number of statements but I don't know if that is
> exactly what we want.

It is amazing the kind of code you write.  :)

            int x = (varnish->bright) ? (x = A_BOLD) : (x = 0)

A double assignment?  First x = A_BOLD, or x = 0, and then again
assign this to int x?  Weird.

> Besides, curses.h looks too big [...]

You don't have to look at that at all.
Just make the two statements exactly this:

            wattron(edit, varnish->attributes);

            wattroff(edit, varnish->attributes);

Then add this attributes element to the colortype, and see where
you have to initiliaze it -- shortly after the pair is initialized.

Look at line 65 of color.c for inspiration.

Benno

-- 
http://www.fastmail.com - Accessible with your email software
                          or over the web




reply via email to

[Prev in Thread] Current Thread [Next in Thread]