nano-devel
[Top][All Lists]
Advanced

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

[PATCH] Syntax: Added syntax for Python decorators.


From: matteo_luigi_raso
Subject: [PATCH] Syntax: Added syntax for Python decorators.
Date: Wed, 18 Jan 2023 07:02:59 +0000

Decorators are an important part of the Python language, so GNU nano should
give them a colour instead of ignoring them. For the syntax, I start the
colouring at "@" and end it at either a blank space or a newline. The
reason I stop the syntax after a blank space is because "@" doubles as an
operator in Numpy and downstream packages, so we have to take care to not
mess up the entire line if "@" is used that way. One slight problem is that
the syntax colouring will also apply to any arguments passed to the decorator
if a space isn't placed between the opening bracket and the decorator.

e.g. "@dec(a)" will be one colour, which might be slightly unaesthetic.

This isn't much of a problem though, since it can be easily fixed by going

"@dec (a)"

Sent with Proton Mail secure email.

Attachment: 0001-Signed-off-by-Matteo-Raso-matteo_luigi_raso-protonma.patch
Description: Text Data


reply via email to

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