[RFC]DocumentPrivate: Auto unwrap line when text is removed
Needs RevisionPublic

Authored by loh.tar on Feb 15 2019, 7:11 PM.


Group Reviewers

Such patch seems to be missing to achieve the desired behavior to auto
reformat a paragraph with enabled static word wrap.

The reformat takes without this patch only place when text is added but
not removed.

Test Plan
  • Enable static wrap
  • Enter enough text to force auto wrap over a couple of lines
  • Add at some point in the middle of your text a "hard wrap/new paragraph" by simply press ENTER
  • Add in the upper paragraph more text -> lines below will auto reformat down to "hard wrap"
  • Remove new added text by DEL -> with patch paragraph gets reformat too
  • New behavior also affects text which was wrapped by "Apply Word Wrap" when static wrap is off, but for me is that's fine
  • It's looking similar as done at other places but I'm not sure if it's best this way due to my goals mentioned elsewhere
  • In current state can this patch crash when do "undo"

Diff Detail

R39 KTextEditor
Lint Skipped
Unit Tests Skipped
loh.tar created this revision.Feb 15 2019, 7:11 PM
Restricted Application added projects: Kate, Frameworks. · View Herald TranscriptFeb 15 2019, 7:11 PM
Restricted Application added subscribers: kde-frameworks-devel, kwrite-devel. · View Herald Transcript
loh.tar requested review of this revision.Feb 15 2019, 7:11 PM
cullmann requested changes to this revision.Mar 31 2019, 10:49 AM

Hmm, I am not sure if that is the right place for this.

I think the wrapText call in KTextEditor::DocumentPrivate::editEnd() should handle this.

This revision now requires changes to proceed.Mar 31 2019, 10:49 AM