Bug 504332

Summary: Dynamic word wrap: allow user to adjust level of indentation
Product: [Applications] kate Reporter: Sam Birch <bugs.kde.org>
Component: partAssignee: KWrite Developers <kwrite-bugs-null>
Status: REPORTED ---    
Severity: wishlist    
Priority: NOR    
Version First Reported In: 25.04.0   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Sam Birch 2025-05-16 13:40:00 UTC
SUMMARY

In order to better differentiate a dynamically-wrapped line, katepart should let me specify an additional number of columns to indent wrapped lines.

STEPS TO REPRODUCE

1. Open, say, KWrite.
2. Type some long lines, one of which is indented.
3. Enable "Dynamic word wrap"
4. Enable "Indent wrapped lines"
5. Set (proposed option): "Indent wrapped lines an additional [__2__] columns"

OBSERVED RESULT (without proposed option)

|----|----------------------------------------|
|1   |This line starts at column 1 and extends|
|  ↪ |beyond the 40 column window width.      |
|2   |        This line start at column 9 and |
|  ↪ |        also extends beyond 40 columns. |

EXPECTED RESULT (with proposed option)

|----|----------------------------------------|
|1   |This line starts at column 1 and extends|
|  ↪ |  beyond the 40 column window width.    |
|2   |        This line start at column 9 and |
|  ↪ |          also extends beyond 40        |
|  ↪ |          columns.                      |

SOFTWARE/OS VERSIONS

KWrite: 25.04.0
KDE Frameworks: 6.13.0
Qt: Using 6.9.0 and built against 6.9.0
Fedora Linux 42 (KDE Plasma Desktop Edition) (Wayland)
Build ABI: x86_64-little_endian-lp64
Kernel: linux 6.14.5-300.fc42.x86_64

ADDITIONAL INFORMATION

I'm not sure the proposed option is very well named. Another option would be to replace the "Indent wrapped lines" option with something like:

    Indent wrapped lines [ n ] columns relative to [ left margin | first line ].

Current "Indent wrapped lines" options would become:

    unchecked = [ 0 ] + [ left margin ]
      checked = [ 0 ] + [ first line  ]

See also SciTE's wrap.indent.mode and wrap.visual.startindent options. The example configuration above would be equivalent to:

    wrap.indent.mode = 1
    wrap.visual.startindent = 2

See also also BBEdit's "Soft wrap text To" and "Soft-wrapped line indentation" options. It's not as flexible, but it gets the job done mostly.