[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
- [Nano-devel] streamlining a bit of syntax coloring, Benno Schulenberg, 2016/07/12
- Re: [Nano-devel] streamlining a bit of syntax coloring, Rishabh Dave, 2016/07/14
- Re: [Nano-devel] streamlining a bit of syntax coloring,
Benno Schulenberg <=
- Re: [Nano-devel] streamlining a bit of syntax coloring, Rishabh Dave, 2016/07/16
- Re: [Nano-devel] streamlining a bit of syntax coloring, Benno Schulenberg, 2016/07/17
- Re: [Nano-devel] streamlining a bit of syntax coloring, Rishabh Dave, 2016/07/17
- Re: [Nano-devel] streamlining a bit of syntax coloring, Benno Schulenberg, 2016/07/17
- Re: [Nano-devel] streamlining a bit of syntax coloring, Rishabh Dave, 2016/07/18
- Re: [Nano-devel] streamlining a bit of syntax coloring, Benno Schulenberg, 2016/07/21