From e39cf370264005f66ccb964a8ce5383615a7a4ed Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Wed, 25 Mar 2015 13:50:12 +0000 Subject: [PATCH] Not letting hashes inside triple-quoted strings cause comment colouring. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5159 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 4 ++++ doc/syntax/python.nanorc | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index e5472598..353901b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2015-03-25 Benno Schulenberg * doc/syntax/debian.nanorc: Slightly widen and relax the header regex. + * doc/syntax/python.nanorc: Hashes inside triple-quoted strings should + not cause comment colouring. (Inside single-qouted strings neither, + but then quotes in comments will be coloured like strings.) This + solves https://bugs.launchpad.net/ubuntu/+source/nano/+bug/481363. 2015-03-23 Benno Schulenberg * src/text.c (do_alt_speller): Avoid the spell checker reporting diff --git a/doc/syntax/python.nanorc b/doc/syntax/python.nanorc index de876bdb..eb2b36e9 100644 --- a/doc/syntax/python.nanorc +++ b/doc/syntax/python.nanorc @@ -12,12 +12,12 @@ color brightcyan "\<(global|if|import|in|is|lambda|not|or|pass|print|raise|retur # Strings. color brightgreen "['][^']*[^\\][']" "[']{3}.*[^\\][']{3}" color brightgreen "["][^"]*[^\\]["]" "["]{3}.*[^\\]["]{3}" +# Comments. +color brightred "(^|[[:blank:]])#.*$" # Multiline strings. color brightgreen start="\"\"\"([^"),]|$)" end="(^|[^(])\"\"\"" color brightgreen start="'''([^'),]|$)" end="(^|[^(])'''" -# Comments. -color brightred "(^|[[:blank:]])#.*$" # Reminders. color ,yellow "(FIXME|TODO|XXX)" -- 2.39.5