Outlining/highlighting nested blocks of code

Outlining/highlighting nested blocks of code

2
NewbieNewbie
2

    Dec 13, 2008#1

    Hi!

    This is a feature I've always wanted in a source code editor.
    I've made a snapshot of my idea. I've inserted the link to a more detailed snapshot with some comments.

    http://www.geocities.com/armen_sarkissi ... tlined.png <- image can't be viewed anymore!

    please note that:
    - background gets darker as nested block gets deeper.

    thank you!
    Armen

    6,603548
    Grand MasterGrand Master
    6,603548

      Dec 13, 2008#2

      I personally think that with a real syntax highlighting (not blue for all text), indentations (you already use), the code folding feature which divides a source code into logical blocks and lets users show/hide a logical block easily, and using the match brace function to select/highlight a block easily when required is enough visual help from UltraEdit.

      Such an additional graphical highlighting is in my point of view a graphical overkill and would not be helpful for me, the opposite would be the case, I would feel to be very incommoding by this highlighting. Also I think with real syntax highlighting - using more than 1 color for the text - and different background colors for some blocks like comments, the automatic background coloring you suggest would have a very negative affect on the readableness of the source code. And don't think that all users use white as background color. I use for example a light gray, another colleague of mine uses black (darker?) and another blue as main background color.

      Other problems that could occur when implementing such a feature:
      • How to apply such block highlighting when the code is not as perfect indented as yours?
      • How to handle soft wrapped lines or much longer lines with text outside the visible area on left/right side?
      • That grahical block highlighting would be very difficult for files with syntax highlighting when a non proportional font like Arial is used. UltraEdit would already need for your example to determine the width of every block to search for the longest line in the most inner block first, then longest line in the upper block and use its width or the width of the inner block + extra space, and so on. With a non proportional font that would be even more difficult.
      • How long will it take to find the width for every block if (the most inner) block starts for example at file offset 1.251 and ends on file offset 4.348.726? Some users use UltraEdit with syntax highlighting enabled for writing source and additionally for other files too which have a logical structure where such a big logical block is not as rare as for program source code.
      • Which negative affect will have this graphical highlighting in display refresh rate when scrolling and on the execution speed of macros/scripts with that block highlighting enabled?
      There are other suggestions like those discussed in the 2 referenced threads below which some editors (mostly IDEs for a special programming language) support:
      Vertical lines for every indentation level
      Matching IF - ENDIF with lines

      But I think that also these 2 display enhancements are not really needed when using indentations well and a perfect setup for syntax highlighting. Both, especially the vertical lines in the text area for the indentation level, are only needed when using a too high indent space value. For example I use for my 'C' files an indent space value of only 1 space. And all my colleagues said that this is a too low value and they could not read my code. Most of my colleagues changed their opinion about the readableness of my source code files as I have applied my syntax highlighting setup to their installations and they worked 2 weeks with it. It so easy to see that you are on level 5 if the start of the line is column 5. In the last few months I was forced to continue a C++ project from another programmes also with the editor of Visual Studio 6 which has a poor default syntax highlighting (and therefore I often used UltraEdit). In this environment I needed a greater indent space value and used 2 spaces. 3 spaces is also good. But in my point of view more than 3 spaces for indentation is counterproductive. With indent values greater than 3 additional graphical helps are really needed.

      Because I am a developer and write also applications with user interfaces, I can tell you from my personal experience that users often request new features because they don't know what the application can already do (although documented) and how their work with that application could be more efficient and productive if they would really make use of most (all) the existing features.

      However, this is my point of view. You can nevertheless send a feature request email to IDM and you maybe find other people supporting your feature request. Ideas are always welcome.
      Best regards from an UC/UE/UES for Windows user from Austria

      2
      NewbieNewbie
      2

        Dec 13, 2008#3

        Hi Mofi!
        And don't think that all users use white as background color. I use for example a light gray, another colleague of mine uses black (darker?) and another blue as main background color.
        In the snapshot I posted I only wanted to show an overall picture of the idea. That's why I kept everything as simple as possible (no syntax highlighting or etc.) Of course you can choose any color you like, you can go from darker to lighter instead of the opposite. Outlining colors can be anything else. Definitely there should be an option to show/hide the outlining and customize the looks. But the important thing is outlining the blocks and shaded backgrounds.
        ...syntax highlighting, indentations (you already use), the code folding feature and using the match brace function... is enough visual help from UltraEdit.
        I totally agree that those features are great features. The feature I'm suggesting can be used alongside those.
        How to apply such block highlighting when the code is not as perfect indented as yours?
        If programmed correctly it should be able to handle well written code (and not so well written but acceptable code) very well. The languages I had in mind were C, C++, JavaScript, Java and such. Of course someone can write a badly readable code! But the goal is to make a well written code even more readable.
        That grahical block highlighting would be very difficult for files with ... How long will it take to find the width for every block... that would be even more difficult...
        :) difficult!! But the features that UltraEdit has today seemed like REALLY DIFFICULT once!
        But I think that also these 2 display enhancements are not really needed
        I really love the vertical lines! :)
        ...users *often* request new features because they don't know what the application can already do
        But not always! :P