[Top][All Lists]

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

Re: [Nano-devel] [PATCH] Some improvements

From: Liu Hao
Subject: Re: [Nano-devel] [PATCH] Some improvements
Date: Sun, 10 Dec 2017 21:50:37 +0800
User-agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0

On 2017/12/10 21:11, Benno Schulenberg wrote:
> Op 10-12-17 om 06:37 schreef Liu Hao:
>> On 2017/12/10 1:04, Benno Schulenberg wrote:
>>> The new version does not color a lonely #else or #endif.
>> Oops it was an oversight. ... well, how to work around it without
>> look-ahead assertions? :/
> Don't know.  :|

Found a solution anyway. Using a '\>' to match the end of a word seems
to work itself out. New patch attached.

>>> Also, it is a drain on resources: opening a large C file now takes
>>> twice as long. The precalculation of the color info takes roughly
>>> five times as long as for the disabled coloring of multiline
>>> strings.  It was disabled to
>>> avoid irritating slowdowns.  So, I don't think we can do the multiline
>>> regexes for preprocessor directives.
>> I was aware of it anyway, but I think 'large C files' are relatively
>> rare.
> True.
> Hm...  Okay, if you fix the #endif and #else things (and maybe others),
> then we're going to give it a try -- with the multiline command -- see
> if we get any complaints.
> I think #define should not color what comes after it. 

This does not seem practically possible. I tried moving the rule for
MACROs after this rule but it turned out that every occurrence got
colored - not only those following `#define` immediately, but those
inside the macro body.

> Together with
> #else and #endif it should be in a single-line color command.  Maybe
> also #include should be in the single-line one?

This will require two rules, one of which is for the single-line and the
other is multiple-line. I have attached an alternative patch for this.

>>> I have pushed my own version.
>> I have no objection to it as long as everything works expectantly.
> Good.  Thanks.
> Benno
> _______________________________________________
> Nano-devel mailing list
> address@hidden

Best regards,

Attachment: 0002-syntax-adjust-highlighting-of-preprocessor-directive.patch
Description: Text document

Attachment: alt-0002-syntax-adjust-highlighting-of-preprocessor-directive.patch
Description: Text document

reply via email to

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