Comment 4 for bug 318517

Revision history for this message
David (david.regev) wrote :

There is also an upsteam bug for gtksourceview: http://bugzilla.gnome.org/show_bug.cgi?id=326821 .

I would like to amend the original suggestion slightly. When a line is wrapped, instead of inheriting indentation, I think it should inherit the last tabstop. To use a common use case as an example (‘ → ’ represents a tab and ‘ ↲’ represents a soft wrap.):

 → somePieceOfCode(); → // This is a very long comment ↲
                            that spans two lines.

Note that the second line is indented to the position of the most recent tabstop rather than the indentation of the whole line. As far as I know, the other editors that do wrap more intelligently do not take such non-initial tabs into account. I believe that this suggestion yields even more readable text, as the whole comment in now separate from the actual code. This would also be useful in the many cases where text is arranged in a table-like manner. When tabs aren’t inserted in the middle of a line, the result is identical to the the original suggestion.