A problem about html script and style tag autoindent

A problem about html script and style tag autoindent

4
NewbieNewbie
4

    Jul 27, 2008#1

    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?

    262
    MasterMaster
    262

      Jul 28, 2008#2

      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.

      4
      NewbieNewbie
      4

        Jul 28, 2008#3

        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.

          Jul 28, 2008#4

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

          262
          MasterMaster
          262

            Jul 28, 2008#5

            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...

            4
            NewbieNewbie
            4

              Jul 29, 2008#6

              Thank you very much, it's ok.
              The other two question(unindent key and search word without select) can be solved by macro.

              6,682583
              Grand MasterGrand Master
              6,682583

                Jul 30, 2008#7

                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.
                Best regards from an UC/UE/UES for Windows user from Austria