RE: String highlighting
Alain Forget <aforget <at> scs.carleton.ca>
2009-09-03 18:46:09 GMT
Unfortunately, it doesn't seem to help. One problem I noticed straight away
is it seems you chose priorities that are way too low. I think for string
highlighting, they need to set very high (at 9), because if something is
encased in (non-escaped) double-quotes, then it IS a literal string, and
should be highlighted as such, regardless of the contents of that string. So
for example,
x = 1 + 2 should be highlighted as R-code, so my current settings have
digits highlighted in one colour, and operators (=, +) a different colour,
and variables (x) highlighted a third colour.
"x = 1 + 2" should be all one colour, the colour of a literal string, so
string highlighting should override ANY other highlighting.
However, even if I set the priorities to 9, the Filter you suggested simply
does not appear to have any effect meaningful effect, and neither does the
Switch. If you want to try it out yourself, I could probably export my
settings and send them to you, as well as a code excerpt that demonstrates
the problem. I probably shouldn't send files to the mailing list, so please
let me know if you'd like me to export and send you my highlighting
settings.
I very much appreciate all the help you (or anyone else) can provide.
Alain
-----Original Message-----
From: David Huffer [mailto:David.Huffer <at> csosa.gov]
Sent: September 1, 2009 10:30
To: winedt+list <at> wsg.net
Subject: RE: [WinEdt] String highlighting
On Monday, August 31, 2009 5:44 PM, Alain Forget wrote:
> ...So I want all literal strings, those > encompassed with a
pair of double quotes > (for example, "This should be highlighted a
> unique colour"). However, there is one
> exception. If a double quote is preceded by > a backslash, it should
then be treated as a > part of the literal string, and ignored for > the
purposes of double quote matching...
So then couldn't this be handled with just this filter item to identify
double quotes not preceeded by an escape:
Name:R:"
Definition:[""""]
Before:0~\
After:0
Enabled:1
Strict Priority:0
Priority:0
Color:34128
and then this switch to highlight (unescaped) double-quoted text:
Name:R:String
Start:1R:"
Stop:0R:"
Start1:
Start2:
Stop1:
Stop2:
Enabled:1
Strict Priority:0
Priority:0
Color:34704
Case Sensitive:0
Scope Flag:1
Scope:3
Indented:0
BOLN:0
Does that help?
--
David
-----------------------------------------------------
David Huffer, Ph.D. Senior Statistician
CSOSA/Washington, DC david.huffer <at> csosa.gov
-----------------------------------------------------