

How can a code editor hint at code nesting level without indentation? - splattne
http://programmers.stackexchange.com/questions/87077/how-can-a-code-editor-effectively-hint-at-code-nesting-level-without-using-inde

======
wccrawford
So far the only idea is to indent everything and use a graph to shot the
nesting level?

If we got rid of indentation, I'd like to think it was replaced by something
that took less space, not more.

~~~
asolove
The context in the original question makes clear: the OP is not looking to
save space. He wants to take out the structural (tabbed) spacing inherent from
the nesting of XML in order to make it visually clear where documents have
manually-inserted whitespace.

This is actually a really interesting question, although I'm not sure the
answers there are very helpful. I would prefer seeing the code actually
indented, and then a light-gray visual guideline where the structural
indentation ends, e.g.:

    
    
      |<xml:something>
        |<xml:what-the>
          |  left some extra whitespace
        |</xml:what-the>
      |</xml:something>

~~~
ars
He wants automatic detection of nesting?

Good luck with that, considering I find it hard to manually decide how to
indent mixed PHP, HTML and Javascript code. I can't imagine an automatic tool
having any success.

~~~
lurker19
The point is to have multiple layout/decoration algorithms to toggle between,
depending on which aspect of the code the user wants to focus on.

~~~
ars
Tell me how it could indent this correctly:

    
    
        <?if(bool):?>
          <TABLE class="foo">
        <?else:?>
          <TABLE class="bar">
        <?endif;?>
            <TR><TD></TD></TR>
          </TABLE>
    

If you only look at the HTML it looks like a doubly nested table.

If you only look at the PHP the inner elements of the table will not be
indented correctly.

And this is a very simple example. Real code can be far more complex - for
example the table tag could be generated by a function, and not even visible
in this file.

If you took my indenting, and converted it into some kind of graphical display
that might be cool. But automatic detection? Good luck.

~~~
asolove
This is not the question asked. The question is specifically about XML
documents, where there is a single and quite easy correct answer for the
indentation.

------
chanux
I wondered how his final result would look like with a little modification...

<http://imgur.com/u5mNi>

------
adriand
I believe Xcode 4 does something similar to the heatmaps shown here, although
it does everything vertically, in shades of gray. You can sort of see it in
this screenshot - look in the left-hand margin of the code editing window.
<http://www.neowin.net/images/uploaded/xcode4.jpg>

~~~
sil3ntmac
I get a 403 forbidden (check your permissions maybe?)

~~~
idonthack
outside referrers are blocked, copy and paste the url

~~~
Retric
When there is no redirect so you can click a link, and then just hit CR on the
blocked page's URL.

------
zitterbewegung
Why not color the backround of the text and not have it as a side bar?

------
bane
Curly braces.

