billthefarmer / editor

Android simple text editor
https://billthefarmer.github.io/editor
GNU General Public License v3.0
474 stars 85 forks source link

Improving readability of wrapped lines #176

Closed Markus00000 closed 2 years ago

Markus00000 commented 2 years ago

I often find wrapped lines hard to read. Is the line wrapped? Is there a new line? Where does this indented block end?

Vim has this feature:

:he breakindent Every wrapped line will continue visually indented (same amount of space as the beginning of that line), thus preserving horizontal blocks of text.

Without line numbers and without reading the first line, it can be difficult to understand whether the first wrapped line is wrapped or a new line:

nobreakindent

With breakindent it becomes somewhat easier (at least parsing the indented block becomes easier):

breakindent

With breakindent and indentation indicators even more cases become clear (excluding unindented lines that wrap):

lines

Unindented lines that wrap become clear with end-of-line characters:

list

Inserting a character at the beginning of wrapped lines (e.g. ↳) is another possibility. This might pair well with breakindent and might be easier to implement than lines as indentation indicators. Vim uses :set showbreak=↳ to enable this:

wrap-indicator

billthefarmer commented 2 years ago

There are two points. First this app uses the android TextView API to implement the basic text editing function. Implementing this would involve inserting blanks into the text in carefully calculated places and removing them again when the line is no longer in view or the file is saved. I'm not going there. Second the app offers word wrap as an option. Turn it off and you can scroll sideways to see what is what.