Highlight tag content (=code folding sections), tag matching feature?

Highlight tag content (=code folding sections), tag matching feature?

2
NewbieNewbie
2

    Sep 02, 2006#1

    Hello,
    I'm wondering if it is possible to highlight the content of a tag resp. The content of a code folding section - similiar to the active line highlighting. In PSPad is an option "Select Tag" that comes close to this. Still it would be much more usefull to automatically highlight a tag on click instead of selecting it. Also nice would be an option to lock such a highlighting (for easy editing within).

    If this is not possible I would suggest it as a feature to be added :)

    6,675585
    Grand MasterGrand Master
    6,675585

      Sep 06, 2006#2

      Well, UltraEdit/UEStudio is not as optimized as PSPad for webpage editing.

      A macro can be used for selecting the characters between two HTML tags as posted at Some questions about functions. But it is definitively not perfect, especially on nested elements. If your HTML code is always as perfect indented as in your screenshot (deleted later), an improved macro code could select always the correct matching end tag for the current tag.

      But I think locking a selection will never be available in UltraEdit/UEStudio.

      You could only temporarily convert the current selection to an alternate comment with different background color and when finished editing in it remove the alternate comments with a macro.

      Also you could use the multi-language syntax highlighting feature to highlight a selection temporarily with a different background color. For example if you never use ASP in your HTML files you could copy the whole HTML language definition in your wordfile to an other language number and replace HTML_LANG by ASP_LANG. Then you need a macro which adds before and after current selection the start and end tag for VBScript and a second macro which removes these elements next the current cursor position when "locking" should be disabled.

      Both are dirty tricks, but maybe useful for you.

      However, feature requests can be always send to IDM.
      Best regards from an UC/UE/UES for Windows user from Austria

      2
      NewbieNewbie
      2

        Sep 06, 2006#3

        Thank you for your exhaustive answer :)
        Mofi wrote:If your HTML code is always as perfect indented as in your screenshot ...
        If I create a new file myself I try to stick to a good formatting. But the reason in the first place for my question was, that I sometimes have a hard time to understand other people's layout/structure in files. The file in the screenshot wasn't from me too, but the the "Reformate HTML Code" option in PSPad was quite useful (if not completely failsafe) ;)

        Anyway, it's not that important to fall back to some "dirty tricks", but I still think that it should be pretty easy to implement, since UE already does recognize start and end tags pretty well (-> code folding). It got just to be vice versa (in a way) - highlight instead of hide :)

        6,675585
        Grand MasterGrand Master
        6,675585

          Sep 07, 2006#4

          Extra hint: Use HTML Tidy with the appropriate options to reformat bad formatted HTML files.
          Best regards from an UC/UE/UES for Windows user from Austria

          1
          NewbieNewbie
          1

            Jul 11, 2007#5

            Is there any feature to match HTML tags?

            Say when the cursor is in an opening DIV tag - UE will highlight the closing tag?

            a coworker was using PSPad and I tried it and it had that feature - but I love UE too much to switch.

            Maybe there are some features like that?
            And an ability to collapse block of codes or tags or so.
            Or to auto fix the indentation in code (Java or HTML or ...)

            Please advise.

            Thank you all.

            6,675585
            Grand MasterGrand Master
            6,675585

              Jul 11, 2007#6

              Yes and no. You can use the code folding feature. Fold the current block (div, p, table, ...), select the folded block and unfold it and you will see whole block selected.

              The macros at Finding matching tag could be also helpful for you and there I have also explained how to modify the match brace feature of the syntax highlighting engine. I have never tested if this suggestion really works. The post was for XML, but HTML is very similar.

              Collapsing block of codes can be done with the code folding feature.

              Re-indenting can be done with the Format - ReIndent Selection if the indent and unindent strings are good customized by you in the syntax highlighting wordfile for HTML, JavaScript, etc.

              See also the topic Highlight matching HTML tag.
              Best regards from an UC/UE/UES for Windows user from Austria