chocolat-public icon indicating copy to clipboard operation
chocolat-public copied to clipboard

[Indentation when Wrapping]

Open lifely opened this issue 12 years ago • 12 comments

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.

lifely avatar Aug 09 '11 21:08 lifely

I would love to see this implemented, too.

simonheimlicher avatar Aug 10 '11 15:08 simonheimlicher

Same here, would love this.

julians avatar Sep 05 '11 08:09 julians

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.

atg avatar Sep 06 '11 02:09 atg

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.

amcgregor avatar Sep 07 '11 01:09 amcgregor

Showing invisibles or tabstop guides might solve the problem of not knowing whether its wrapped or a new line.

knubie avatar Dec 14 '11 22:12 knubie

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

amcgregor avatar Dec 15 '11 00:12 amcgregor

So I'm thinking of doing hatching over the added indentation. Now the question is, how the hell to implement this?

atg avatar May 12 '12 14:05 atg

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)?

daisylb avatar Jun 04 '12 03:06 daisylb

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.

vocaro avatar Jun 16 '12 16:06 vocaro

I would love to see this feature as well. Having that may be enough to get me to move over.

donut avatar Sep 16 '12 00:09 donut

I can't use this tool without this feature. Looking good so far...

hubapps avatar Oct 27 '13 18:10 hubapps

Did this idea get canned?

bobrocke avatar Apr 09 '17 21:04 bobrocke