VDR User | 22 Aug 2011 00:56
Picon

Re: About highlighting..

On Sun, Aug 21, 2011 at 2:47 PM,  <alpha <at> qzx.com> wrote:
>> First, is the highlighting supposed to identify functions which have
>> no closing bracket?  And if so, is it broken?  Is it turned off by
>> default and would need to be turned on?  And example (bash):
>>
>> some_function () { echo "this is fine"; }
>> some_function () { echo "this is NOT fine";
>
> This is not supported by nano's syntax highlighting engine. The rules can only highlight a pattern or
everything between two patterns.
>
> color black,red "[][(){}]"
> color yellow start="\[" end="\]"
> color yellow start="\(" end="\)"
> color yellow start="\{" end="\}"
>
> If you place that at the top of the syntax file and then remove
> all brackets from the existing rule you will see that it highlights your sample code just fine and catches
open brackets. The first problem is that it highlights everything between the brackets with the bracket
color. The second problem is that it doesn't work with nested brackets.
>
> foo{ bar{}
>
> It catches the open brackets until you type the final closing bracket, at which point the first opening
bracket matches with the closing bracket and everything in between is highlighted yellow.

Hi.  Thanks for your quick reply!  So _should_ nano highlighting
support nested brackets then?  It seems like a completely sane
expectation imo but I wonder if there are any good arguments against
it?

Best regards,
Derek

_______________________________________________
Nano-devel mailing list
Nano-devel <at> gnu.org
https://lists.gnu.org/mailman/listinfo/nano-devel

Gmane