Live data from Hacker News

How can a code editor hint at code nesting level without indentation?

programmers.stackexchange.com

1–10 of 25 posts

Re: How can a code editor hint at code nesting level without indentation?

#3

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.

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

  |
    |
      |  left some extra whitespace
    |
  |

Re: How can a code editor hint at code nesting level without indentation?

#4
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

Re: How can a code editor hint at code nesting level without indentation?

#5
post #3

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.

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 t…

Yes, I like your approach the most of those listed.

Re: How can a code editor hint at code nesting level without indentation?

#6
post #3

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.

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 t…

It's been a while since I used an IDE (instead of vim), but don't most of them support code-folding that provides a light gray bracket for a block of code (usually with a collapsible indicator at the top)?

Or is the effect you want slightly different?

Re: How can a code editor hint at code nesting level without indentation?

#7
post #4

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

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

Re: How can a code editor hint at code nesting level without indentation?

#8
post #4

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

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

outside referrers are blocked, copy and paste the url

Re: How can a code editor hint at code nesting level without indentation?

#10
post #4

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

I tried to post a comment to this effect on stack exchange, but it wouldn't let me post images.

XCode does this in a single column using varying shades of grey:

   http://i.stack.imgur.com/frCcI.png
The grey rectangles may also be clicked on to fold text. On hover you see:

   http://i.stack.imgur.com/EzjXW.png
And after folding you see:

   http://i.stack.imgur.com/wsNRR.png
Post reply on HN