Problem with code folding in comment lines

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

Problem with code folding in comment lines

Postby bunny_ear_tv » Mon Nov 12, 2007 12:25 pm

UltraEdit 13.20+2, Windows XP Pro SP2

I have added a language definition to wordfile.txt (for PowerShell) with these lines:

Code: Select all
/L14"PowerShell" Nocase DisableMLS Line Comment = # String Chars = "' Escape Character = ` File Extensions = PS1
/Delimiters = :;(){}[] ,#
/Indent Strings = "{" "if" "else" ":"
/Unindent Strings = "}"
/Open Brace Strings =  "{"
/Close Brace Strings = "}"
/Open Fold Strings = "{"
/Close Fold Strings = "}"
/Open Comment Fold Strings = "Region"
/Close Comment Fold Strings = "Endregion"


Code folding is enabled for #Region/#Endregion lines and for functions. What I want is for code folding to only be enabled for the comment line strings (#Region/#Endregion) and not for functions. But if I remove the /Open Fold Strings and /Close Fold Strings lines, then the other type of folding fails to work.

Is this a bug or is there a workaround for this?

Thanks,
Chuck
User avatar
bunny_ear_tv
Newbie
 
Posts: 5
Joined: Wed Feb 16, 2005 12:00 am

Re: Problem with code folding in comment lines

Postby Mofi » Mon Nov 12, 2007 2:17 pm

Simply specify open and close fold string not present ever anywhere in your PSL files like:

/Open Fold Strings = "openfoldnotused"
/Close Fold Strings = "closefoldnotused"
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4058
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Problem with code folding in comment lines

Postby bunny_ear_tv » Tue Nov 13, 2007 6:03 pm

Mofi, thanks, your suggestion works perfectly!

Chuck
User avatar
bunny_ear_tv
Newbie
 
Posts: 5
Joined: Wed Feb 16, 2005 12:00 am


Return to Syntax Highlighting