nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 7c174a1a2565e96327da677e437c5c70af5a18bf
parent f0e69b4a5197c394739bacc0cf1f077590b766e9
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Mon,  8 Jan 2024 11:40:49 +0100

syntax: c: require a preceding blank when a line comment contains a quote

This avoids miscolorizing part of a string when it contains a URL.

This fixes https://savannah.gnu.org/bugs/?64340.
Reported-by: Yonut Smith <deanlast3@gmail.com>

Problem has existed for more than twenty years, at least since support
for multine-line regexes was added in commit 6c1e6612 in 2002.

Diffstat:
Msyntax/c.nanorc | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/syntax/c.nanorc b/syntax/c.nanorc @@ -36,7 +36,7 @@ color brightcyan start="^[[:blank:]]*#[[:blank:]]*(if(n?def)?|elif|warning|error color brightcyan "^[[:blank:]]*#[[:blank:]]*((define|else|endif|include(_next)?|line|undef)\>|$)" # Comments. -color brightblue "//.*" +color brightblue "//[^"]*$|(^|[[:blank:]])//.*" color brightblue start="/\*" end="\*/" # Reminders.