Ticket #4492 (closed enhancement: duplicate)
Implementation of screen-only division of long lines
Reported by: | psprint | Owned by: | |
---|---|---|---|
Priority: | major | Milestone: | |
Component: | mcedit | Version: | master |
Keywords: | soft-wraps,wraps,long-lines | Cc: | kybl |
Blocked By: | Blocking: | ||
Branch state: | no branch | Votes for changeset: |
Description
Hi,
I've implemented screen-only division of long lines. I'll call it soft wraps.
I think that this feature is missing from mcedit. Currently, when a line exceeds the screen it is scrolled right. This is, IMHO, a less effective way of working with long lines. More natural is to have them soft-divided by the editor with moving, home/end keys support, etc.
The patch is little long and complex, but I'm using it from 2 years with no problems. To have the lines soft wrapped, select "Soft wraps" in the General options dialog.
Attachments
Change History
Changed 16 months ago by psprint
- Attachment 0001-Implementation-of-soft-wraps-screen-only-division-of.patch added
comment:1 Changed 16 months ago by psprint
A short demo: https://asciinema.org/a/JGe9zeiPly6CfIG49sA6Y7r30
comment:3 Changed 16 months ago by ossi
your example is kinda counter-productive, as code is the exact thing one usually shouldn't soft-wrap.
that also illustrates that the setting needs to be switchable via a hotkey, as it is in the viewer.
another aspect is that a good soft-wrap implementation (*) somehow visualizes the continued lines, which is particularly important for text without indentation. this can be easily done by visualizing line breaks along with other whitespace (see libreoffice) when soft-wrapping is enabled. another style is to indent everything, and put some marker in front of continuation lines. yet another style i've seen (in kate or qt creator) is indenting the continuation lines like their "parent" lines and filling the leading whitespace with a grey-ish pattern, but this obviously doesn't work for non-indented text.
(*) the textedit i'm just entering this into clearly isn't a good implementation ...
Add soft wraps to MCEdit