Unindenting problem with VBScript

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

Unindenting problem with VBScript

Postby s_m_b » Fri Nov 10, 2006 1:41 pm

I find (using VBscript) that if a keyword for 'reindenting' gets inserted part way into a line of code, the auto-reindent happens

Is this by design, or can I switch if off somehow - example:

Code: Select all
on error resume next


the line isn't part of a loop, and hasn't a 'closer' line, like

Code: Select all
with somefunctionname
   .method1
end with

is.
However, it contains the keyword, so gets shifted back one tab, which is really irritating!
User avatar
s_m_b
Basic User
Basic User
 
Posts: 13
Joined: Thu Sep 01, 2005 11:00 pm

Re: Unindenting problem with VBScript

Postby pietzcker » Mon Nov 13, 2006 10:33 am

Hi,

I don't know VBScript, so just for clarity: Which is the keyword that causes "out"denting?

This is an interesting thread, it nicely complements the threads about false indenting if the indent keyword is somewhere within a line... see Indenting only when a character is at end of prior line?

Regards,
Tim
User avatar
pietzcker
Master
Master
 
Posts: 241
Joined: Sun Aug 22, 2004 11:00 pm

Re: Unindenting problem with VBScript

Postby s_m_b » Mon Nov 20, 2006 10:12 am

'next' - from a 'for....next' loop.

You can see it doing it, by just typing 'on error resume' and the line stays in place, but then add 'next' and it jumps back .
User avatar
s_m_b
Basic User
Basic User
 
Posts: 13
Joined: Thu Sep 01, 2005 11:00 pm

Re: Unindenting problem with VBScript

Postby Mofi » Mon Nov 20, 2006 3:17 pm

UltraEdit is a general text editor not written for only a certain number of programming languages like Visual Studio. So UltraEdit cannot handle special language dependent exceptions like Visual Studio or other editors written for a specific programming language.

If you don't want unindentation when you enter the word "next", then remove this word in the wordfile in the line starting with /Unindent Strings = for language /L10"VBScript Active Server Pages".
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4066
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Unindenting problem with VBScript

Postby s_m_b » Wed Nov 22, 2006 10:50 am

So UltraEdit cannot handle special language dependent exceptions like Visual Studio or other editors written for a specific programming language.

Kind of surprising that UE can't handle something as basic as only scanning the first word in the line for that - for a general text editor its pretty powerful in all other ways!
User avatar
s_m_b
Basic User
Basic User
 
Posts: 13
Joined: Thu Sep 01, 2005 11:00 pm

Re: Unindenting problem with VBScript

Postby Mofi » Wed Nov 22, 2006 11:33 am

Scanning only the first word on a line for an indent / unindent string would maybe the right solution for VBScript, but it is definitively not the right one for 'C'. See following examples:

Code: Select all
if(var1) {
   printf("var1");
}

if(var2)
{
   printf("var2");
}

if(var3) { printf("var3"); }

if(var4) {
   printf("var4"); }

if(var5) { printf("var5");
   printf("\n");
}

Indenting on { and unindenting on } should work here in all cases.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4066
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Unindenting problem with VBScript

Postby s_m_b » Thu Nov 23, 2006 9:47 am

same principle applies to Perl, but to my mind that's just code layout management?

Perhaps then some basic rules in a similar vein to regexs?
'if word x and word y together, don't indent/unindent' ?
User avatar
s_m_b
Basic User
Basic User
 
Posts: 13
Joined: Thu Sep 01, 2005 11:00 pm

Re: Unindenting problem with VBScript

Postby Mofi » Thu Nov 23, 2006 11:10 am

s_m_b wrote:Perhaps then some basic rules in a similar vein to regexs?
'if word x and word y together, don't indent/unindent' ?

Maybe you can have this effect when you add word "error" or "resume" to the indent strings.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4066
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna


Return to Syntax Highlighting