[scintilla:bugs] #1661 Post-indentation wrap break usually makes text look worse

0 views
Skip to first unread message

Mike Cowperthwaite

unread,
Oct 10, 2014, 12:33:07 PM10/10/14
to scintill...@googlegroups.com

[bugs:#1661] Post-indentation wrap break usually makes text look worse

Status: open
Group: Bug
Created: Fri Oct 10, 2014 04:33 PM UTC by Mike Cowperthwaite
Last Updated: Fri Oct 10, 2014 04:33 PM UTC
Owner: nobody

If you have a line that contains just indentation and an unbroken string (say, a URL) and it wraps, the wrap algorithm forces a break between the indentation and the beginning of the text. This gives the appearance of a blank line before the text, and depending on the WrapIndentMode, could result in more lines of wrapping than if the initial, post-indentation break had not been applied.

See the attachments.

  • wrap_result_FIXED_0: uses SC_WRAPINDENT_FIXED. Blank line appears before the two long URLs; the first long URL thereby shows unbroken (arguably a benefit), the second long(er) URL takes up two lines.
  • wrap_result_SAME: uses SC_WRAPINDENT_SAME. Blank lines appear before the two long URLs and both are broken midway, but no worse than they would have been if the initial, post-indent break had not been made.
  • wrap_result_INDENT: uses SC_WRAPINDENT_INDENT. Blank lines appear before the two long URLs, and the longer URL now is broken in two spots: it now occupies four rows where it could have occupied just two.

I think breaking immediately after initial indentation should be suppressed in all cases.


I note that, if indented using non-breaking spaces instead of tabs or spaces, the text is treated as if no indentation was applied (good). And other Unicode spaces (ensp, emsp, etc) provide the same break behavior as a regular space does (also good).

Also, as an aside, having a WS symbol for the nbsp (when whitespace is visible) would be a nice feature. I think CodeWright used the "white circle" character '○' U+25CB for the nbsp. For the other Unicode breaking spaces, maybe use the same middle-dot character '·' as for plain old 0x20, rather than trying to distinguish between them all.


Sent from sourceforge.net because scintill...@googlegroups.com is subscribed to https://sourceforge.net/p/scintilla/bugs/

To unsubscribe from further messages, a project admin can change settings at https://sourceforge.net/p/scintilla/admin/bugs/options. Or, if this is a mailing list, you can unsubscribe from the mailing list.

Neil Hodgson

unread,
Oct 10, 2014, 5:15:09 PM10/10/14
to scintill...@googlegroups.com

You may prefer the SC_WRAP_CHAR mode where wrapping is performed on any character instead of on whitespace.

Mike Cowperthwaite

unread,
Oct 11, 2014, 2:00:17 PM10/11/14
to scintill...@googlegroups.com

Yes, that behavior is more like I would like to see -- for a long string. That doesn't mean that the current behavior for SC_WRAP_WORD wouldn't be improved if post-indent wrapping were suppressed as I suggest: for regular paragraphs of text, the whitespace breaking is preferable. (It's tempting to ask for Unicode-style breaking, with numeric-context-aware breaks around the hyphen-minus, but that doesn't really apply for the URL case anyway.)

Of course, there are pathological narrow-window cases where any kind of wrapping could be seen as "failing" in various content-specific ways.

Also, Notepad++ doesn't offer a feature to set the wrap mode, so a scripting plugin is required. That's not your problem, of course.


[bugs:#1661] Post-indentation wrap break usually makes text look worse

Status: open
Group: Bug
Created: Fri Oct 10, 2014 04:33 PM UTC by Mike Cowperthwaite

Last Updated: Fri Oct 10, 2014 09:15 PM UTC
Owner: nobody

Studio 308

unread,
Feb 13, 2026, 4:14:09 PMFeb 13
to scintill...@googlegroups.com

Recently found this behavior confusing and was directed from Notepad++ here.
https://github.com/notepad-plus-plus/notepad-plus-plus/issues/15749#issuecomment-3894449412

From what I understand there's a different mode that can help, but you can't combine both modes for different cases and in first place it is nonsense that long word is getting wrapped from blank line with only tabs or spaces, it simply doesn't look right and shouldn't work like that.

My additional proposal is that you should allow breaking long words by percent of viewport and this will help better filling the space instead of just wrapping each word that doesn't fit line to next line. I mean, if you have some free space on the line after last word and this space is at least 20% (for example) of viewport - the word should be placed in that space and broken at the margin to the next line.


[bugs:#1661] Post-indentation wrap break usually makes text look worse

Status: open
Group: Bug
Created: Fri Oct 10, 2014 04:33 PM UTC by Mike Cowperthwaite

Last Updated: Sat Oct 11, 2014 06:00 PM UTC
Owner: nobody
Attachments:

Neil Hodgson

unread,
Feb 13, 2026, 4:23:50 PMFeb 13
to scintill...@googlegroups.com

You should implement your preference so that its behaviour can be tried by others.


[bugs:#1661] Post-indentation wrap break usually makes text look worse

Status: open
Group: Bug
Created: Fri Oct 10, 2014 04:33 PM UTC by Mike Cowperthwaite

Last Updated: Fri Feb 13, 2026 09:14 PM UTC
Owner: nobody
Attachments:

Reply all
Reply to author
Forward
0 new messages