Completing HTML Tags / how to get out

This forum is user-to-user based and not regularly monitored by IDM.
Please see the note at the top of this page on how to contact IDM.

Completing HTML Tags / how to get out

Postby stevek » Fri Feb 22, 2013 12:33 pm

Hopefully I can explain clearly what I'm looking for. I imagine this feature is in place already.

When I type in something like <li>, UE automatically enters the closing tag </li>. Once I enter what goes in the tag, I have to hit the end key or the arrow keys to get past the closing tag.

Is there a hotkey for getting to the end of your closing tag?
User avatar
stevek
Newbie
 
Posts: 2
Joined: Mon Feb 11, 2008 12:00 am

Re: Completing HTML Tags / how to get out

Postby Mofi » Sun Feb 24, 2013 9:14 am

There is no built-in key to set caret after an ending tag once the text between a tag is entered. There are only the arrow keys. Holding Ctrl key while pressing left/right arrow moves caret left/right by one word, but that is not really helpful in this case.

However, it is quite simple to define a macro with a hotkey for this task. For example name the macro SetAfterEndTag and use one of the following macro codes:

UnixReOff
Find MatchCase ">"
IfFound
Key LEFT ARROW
Key RIGHT ARROW
EndIf


UnixReOff
Loop
Find MatchCase ">"
IfNotFound
ExitLoop
Else
Key LEFT ARROW
Key RIGHT ARROW
IfCharIs "<"
Else
ExitLoop
EndIf
EndIf
EndLoop


The first macro above moves caret after first end tag.

If there are often multiple consecutive end tags, the enhanced second macro could be used to set caret after all end tags without any other character between the ending tags. Of course the second macro works also for a single end tag.

The macro should be saved into a macro file perhaps together with other macros which is configured for being automatically loaded at startup of UltraEdit so that it can be executed by hotkey at any time.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4049
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna


Return to UltraEdit General Discussion