chocolat-public
chocolat-public copied to clipboard
[Indentation when Wrapping]
One of the 'feature' that i've always waited in TextMate 2 is indentation with wrap
Like if you have a long line of code e.g. (i may quote jeannicolas on irc)
initWithBitmapDataPlanes:pixelsWide:pixelsHigh:bitsPerSample:samplesPerPixel:hasAlpha:isPlanar:colorSpaceName:bitmapFormat:bytesPerRow:bitsPerPixel:
If the wrap is activated the line is not indented it's goes down and loose all the indentation.
I would love to see this implemented, too.
Same here, would love this.
Would be nice. Though Xcode 4 does this, and I have to say it's a bit disconcerting, since I'm never sure whether the newline is actually "there" or it's just a wrap (with normal wrapping, it's obvious since the indentation is clobbered).
If we do this, there needs to be some very strong visual indication that a wrap has happened.
Often when writing code I'd like to allow soft wrap to match or increase the indentation level (e.g. for editing three files in vertical columns). Wrapping back to the first column is abrasive on the eyes when attempting to follow blocks of wrapped code, especially in languages where indentation matters such as Python, or any of the text formatting engines like Textile where indentation equals definition list item or block quote.
In Python, especially, I would like to increase the visible indentation level twice… this makes the indentation obviously tied to the previous line instead of a logical block.
Showing invisibles or tabstop guides might solve the problem of not knowing whether its wrapped or a new line.
@knubie Not nearly sufficient enough. The language I program in, Python, treats indentation the same way other languages use braces. When something is wrapped to column zero it instantly looks to my brain like a syntax error. Scrolling through code looking for something, and pausing to examine a line that may or may not prevent the code from compiling is a problem.
So I'm thinking of doing hatching over the added indentation. Now the question is, how the hell to implement this?
To differentiate between real lines and soft-wrapped ones, what about putting some sort of symbol (↪ 21AA RIGHTWARDS ARROW WITH HOOK comes to mind) before the first non-whitespace character of each line (so, to the right of the indenting whitespace, or in the gutter if there isn't any indentation, since there's no line number there anyway)?
Would love to see this feature too, but I hope whatever "visible indicator" is implemented can be turned off for those who don't want/need it.
FWIW, TextMate supports this kind of indentation with the following rule:
indentedSoftWrap = {
format = '$0\t';
match = '\A[ \t]*';
};
It's cool because you can make language-specific rules if you want.
I would love to see this feature as well. Having that may be enough to get me to move over.
I can't use this tool without this feature. Looking good so far...
Did this idea get canned?