ViewPrivate: Make 'Apply Word Wrap' more comfortable

Authored by loh.tar on Mar 4 2019, 6:13 PM.

Description

ViewPrivate: Make 'Apply Word Wrap' more comfortable

Summary:
This patch address not all aspects but should be a step in the right direction.

  • Don't wrap entire document when nothing is selected but wrap current line
  • Join paragraph before wrap to avoid odd result
  • Add new function DocumentPrivate::wrapParagraph for that task
  • Update 'What's This' hint to reflect new behaviour
  • Update 'What's This' hint of dyn wrap too to be more precise

BUG:381985

Old Hints


New Hints

Test Plan:
My arbitrary chosen test data.

1aaaaa aaaa aaaa aaaaaaa
2aa aaaaaaa aaaaaa aaaaaaa aaa aaaa aaaa aaaaaaa aa
3aaaaaaaa aaaaaaa aaaaaaa aaaaaa aaaaaaa aaaaaaaaa aaaaaaaa aaaaaaaa aaaaa aaaaa aaaa aaaa aaaaaaa aa
4aaaaa aaaa aaaa aaaaaaa aa
5aaa aaaa aaaa aaaaaaa aa aaaa aaaaaaa aa aaaaaaa

1----- ---- ---- -------
2-- ------- ------ ------- --- ---- ---- ------- --
3-------- ------- ------- ------ ------- --------- -------- -------- ----- ----- ---- ---- ------- --
4----- ---- ---- ------- --
5--- ---- ---- ------- -- ---- ------- -- -------

1xxxxx xxxx xxxx xxxxxxx
2xx xxxxxxx xxxxxx xxxxxxx xxx xxxx xxxx xxxxxxx xx
3xxxxxxxx xxxxxxx xxxxxxx xxxxxx xxxxxxx xxxxxxxxx xxxxxxxx xxxxxxxx xxxxx xxxxx xxxx xxxx xxxxxxx xx
4xxxxx xxxx xxxx xxxxxxx xx
5xxx xxxx xxxx xxxxxxx xx xxxx xxxxxxx xx xxxxxxx

Before


With Patch

Reviewers: KTextEditor, mwolff, cullmann

Reviewed By: KTextEditor, cullmann

Subscribers: dhaumann, cullmann, mwolff, kwrite-devel, kde-frameworks-devel, KTextEditor

Tags: Kate, Frameworks

Differential Revision: https://phabricator.kde.org/D17949

Details

Committed
cullmannMar 4 2019, 6:14 PM
Reviewer
KTextEditor
Differential Revision
D17949: ViewPrivate: Make 'Apply Word Wrap' more comfortable
Parents
R39:a272e86f07e7: ModeBase::goToPos: Ensure jump target is valid
Branches
Unknown
Tags
Unknown