[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Nano-devel] disable a time-consuming multiline regex?
From: |
Benno Schulenberg |
Subject: |
[Nano-devel] disable a time-consuming multiline regex? |
Date: |
Tue, 01 Dec 2015 21:14:06 +0100 |
Hi all,
The following regex in c.nanorc is very time-hungry:
# Multiline strings. This regex is VERY resource intensive!
color brightyellow start=""(\\.|[^"])*\\[[:space:]]*$" end="^(\\.|[^"])*""
For example, run 'src/nano --cons +4444 src/winio.c',
then press and hold ^Y. See how the flying by of the
pages is fairly smooth.
Then exit nano and run the same command again, and
type ^Y ^K. Then press and hold ^Y. See how after
a few seconds the scrolling begins to stutter and
pause (at least here it does, on a 1.6 GHz Atom).
Maybe that string should be commented out by default?
(When I do so, scrolling becomes fluid.)
Also, the regex doesn't work fully correctly.
For example, run 'src/nano imperfect.c' and type:
"one
two
three"
The string isn't coloured, which is correct, because backslashes
are missing. Now type a backslah after "one" -- all three words
are coloured. But that should happen only when there is also a
backslash after "two". Nano's regexes are not capable of expressing
this, so maybe also therefore such an imperfect matcher should be
disabled?
Benno
--
http://www.fastmail.com - The way an email service should be
- [Nano-devel] disable a time-consuming multiline regex?,
Benno Schulenberg <=