D19131: [RFC] DocumentPrivate: Fix "auto-rewrap" in static wrap mode

loh tar noreply at phabricator.kde.org
Mon Feb 18 20:01:24 GMT 2019

loh.tar created this revision.
loh.tar added reviewers: cullmann, KTextEditor.
Herald added projects: Kate, Frameworks.
Herald added subscribers: kde-frameworks-devel, kwrite-devel.
loh.tar requested review of this revision.

  This patch is very similar to D17949 <https://phabricator.kde.org/D17949> but in this state not a full replacement for that.
  Here is some core function touched which need some watchfulness to make it not even worse.
  Here is the existing behavior what will wrapped without a selection not changed.
  With this patch could be D17949 <https://phabricator.kde.org/D17949> simplified or perhaps their extra features added here.
  This patch has in static wrap mode the potential to re-wrap the paragraph nicely on-the-fly, similar to dynamic wrap, whereas without this patch only the current line is wrapped, but not the following, with the result that the paragraph became cluttered or the preceding line with the result that the paragraph became not optimal wrapped in some situations.
  Looking at other code parts indicate that this behavior is/was desired but seems to got lost at sometime. See also D19051 <https://phabricator.kde.org/D19051>, which looks with this patch obsolete.
  - The "auto-rewrap" can only work when the text is fresh entered, not after some load from disk. Doing a join of the paragraph should trigger the needed change
  - The old wrapText function is now split in three functions
  - The new wrapLine function is very close to old code but some variables are renamed
  Two main issues which needs to be fixed
  - Based on TextLine::isAutoWrapped. This info gets lost when you undo some change
  - The cursor is sometimes misplaced, see pic where the x was DELeted and should be now in line 1 in the middle of the bbbb
  F6622028: pic.png <https://phabricator.kde.org/F6622028>

  R39 KTextEditor



To: loh.tar, cullmann, #ktexteditor
Cc: kwrite-devel, kde-frameworks-devel, #ktexteditor, gennad, michaelh, ngraham, bruns, demsking, cullmann, sars, dhaumann
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kwrite-devel/attachments/20190218/4f5a73e4/attachment.html>

More information about the KWrite-Devel mailing list