A problem about html script and style tag autoindent

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

A problem about html script and style tag autoindent

Postby luyy » Sun Jul 27, 2008 7:35 am

I use ultraedit 14.10, and my wordfile.uem is the same as installed version.
When i create a html file, all tags except script and style indent correctly.
For example:
when i type </script> or </style> , current line does not autoindent with above <script> or <style>, it likes that:
Code: Select all
<head>
    .......
    <script>
         </script>  <-- it does not unindent current line when i type </
</head>

but for other tags such as body, div, when i type </, they will unindent current line. it likes that:
Code: Select all
<body>
......
    <div>
    </div>    <-- when i type </, it will unindent correctly.
</body>

I don't know why?
luyy
Newbie
 
Posts: 4
Joined: Sun Jul 27, 2008 7:14 am

Re: A problem about html script and style tag autoindent

Postby jorrasdk » Mon Jul 28, 2008 2:11 am

Here is why: When you enter <script> UE in fact change the syntax highlighting from HTML to Javascript. Notice the status bar at the bottom of the screen. It will change from HTML to Javascript and it will change back to HTML AFTER </script> when Javascript is then "terminated".

And since </ is not setup as a default unindent for Javascript files, </script> will not unindent.
User avatar
jorrasdk
Master
Master
 
Posts: 275
Joined: Mon Mar 19, 2007 11:00 pm
Location: Denmark

Re: A problem about html script and style tag autoindent

Postby luyy » Mon Jul 28, 2008 7:49 am

thanks.
I create templates for style and script tags to solve this problem.
But i think, Ultraedit should unindent </script> and </style> tags auomatically.
and i have two other questions:
1)Can i redefine the key for unindent(shift+tab), i like ctr+i to unindent.
2)Can ultraedit surpport searching the word without select(i means search word under cursor)?

thanks again.
luyy
Newbie
 
Posts: 4
Joined: Sun Jul 27, 2008 7:14 am

Re: A problem about html script and style tag autoindent

Postby luyy » Mon Jul 28, 2008 7:57 am

If i add "<\" to Javascript Unindent Strings in wordfile, it still doesn't unindent automatically.
luyy
Newbie
 
Posts: 4
Joined: Sun Jul 27, 2008 7:14 am

Re: A problem about html script and style tag autoindent

Postby jorrasdk » Mon Jul 28, 2008 9:36 am

luyy wrote:If i add "<\" to Javascript Unindent Strings in wordfile, it still doesn't unindent automatically.


Hmm, strange. The minute I added </ to unindent

Code: Select all
/L9"JavaScript" JSCRIPT_LANG ...
...
/Indent Strings = "{" "else"
/Unindent Strings = "}" "</"


It started to unindent when I enter </script>.

(I'm not gonna leave it there because I haven't tested for unwanted effects in javascript code).

Show us your definition in your word file. Please check if you did alter the active one Advanced - Configuration - Editor display - syntax highligting - Full path...
User avatar
jorrasdk
Master
Master
 
Posts: 275
Joined: Mon Mar 19, 2007 11:00 pm
Location: Denmark

Re: A problem about html script and style tag autoindent

Postby luyy » Tue Jul 29, 2008 9:33 am

Thank you very much, it's ok.
The other two question(unindent key and search word without select) can be solved by macro.
luyy
Newbie
 
Posts: 4
Joined: Sun Jul 27, 2008 7:14 am

Re: A problem about html script and style tag autoindent

Postby Mofi » Wed Jul 30, 2008 2:05 am

luyy wrote:2) Can UltraEdit surpport searching the word without select (I mean search word under cursor)?

Yes, if you enable Configuration - Search - Miscellaneous - Find dialog defaults to word under cursor. Now you only have to press Ctrl+F followed by Return. But verify if the regular expression option or other special options are not checked when running a normal search for a word.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4062
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna


Return to Syntax Highlighting