Perl --> \S autocorrects to \s

Syntax highlighting, code folding, brace matching, code indenting, and function list

Perl --> \S autocorrects to \s

Postby Jakobud » Thu Dec 09, 2004 4:39 pm

Okay so using regular expressions in my Perl syntax in Ultraedit, and whenever I try to type \S it auto-corrects to \s, which is a totally different expression! How do I keep it from doing this? After looking into the Help file, I thought that maybe have "NoCase" added to the Perl section of my wordfile would make the difference, but nope...
User avatar
Jakobud
Newbie
 
Posts: 3
Joined: Tue Sep 07, 2004 11:00 pm

Re: Perl --> S autocorrects to s

Postby Mofi » Fri Dec 10, 2004 4:03 am

The correct no case definition is Nocase and not NoCase. UltraEdit makes case-sensitive compares during looking for definitions.

You can also simply turn off the Auto Correct Keywords feature at Advanced - Configuration - Syntax Highlighting.

Other solutions:

In the Syntax Highlighting configuration dialog click on the button Open to open the wordfile and close the dialog with Cancel. Then scroll down to the Perl language definition which is in standard wordfile.txt of UE v12.10 the line starting with /L5"Perl".

Next search down for a single s character. In standard wordfile.txt it can be found in the color section /C4"Operators".

1) As miket describes delete the single s (whole line in standard wordfile.txt).

2) Or add an upper case single S at the correct line which would be in the standard wordfile.txt in a new line before the character ^.

The first alternate solution is better if you don't want the single s highlighted.
The second alternate solution is better if you want the s in any case also highlighted.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4066
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Perl --> S autocorrects to s

Postby miket » Fri Jan 28, 2005 12:11 am

Another fix that doesn't require turning off auto correction: edit wordfile.txt (in your ue directory), find the perl section and remove the line with the single 's'. I would comment it out if I knew how to comment out this file. You can now leave auto correct on for Perl. It will ignore \S (which bit me today) and probably also ignore the case of s///, but hey, that's for the interpreter...

Regards.
User avatar
miket
Newbie
 
Posts: 2
Joined: Fri Jan 28, 2005 12:00 am

Re: Perl --> S autocorrects to s

Postby Mofi » Sun Sep 10, 2006 8:03 am

A question to all Perl programmers:

Should IDM modify the standard wordfile.txt with either solution 1) or 2)?

If the answer is yes, which solution would you prefer?
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4066
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Perl --> S autocorrects to s

Postby justincallison » Sun Sep 10, 2006 8:29 pm

Thanks for the solution, this has been mightily annoying for me as well. I'd suggest going with Solution #1, since highlighting the lower case s for substitutions in reg exps doesn't seem like a huge help to me. But leaving this as is (where \S autocorrects to \s) is a big deal. I use \S a lot and this was almost annoying enough to make me switch editors.

Thanks Mofi,

Justin
User avatar
justincallison
Newbie
 
Posts: 1
Joined: Fri Sep 08, 2006 11:00 pm


Return to Syntax Highlighting