D17949: ViewPrivate: Make 'Apply Word Wrap' more comfortable

2019-03-04 Thread Christoph Cullmann
cullmann accepted this revision.
cullmann added a comment.


  Given we have a test, the code is documented and nobody raises large 
objections since long over the latest implementation, I think this shall go in 
:=)

REPOSITORY
  R39 KTextEditor

REVISION DETAIL
  https://phabricator.kde.org/D17949

To: loh.tar, #ktexteditor, mwolff, cullmann
Cc: dhaumann, cullmann, mwolff, kwrite-devel, kde-frameworks-devel, 
#ktexteditor, domson, michaelh, ngraham, bruns, demsking, sars


D17949: ViewPrivate: Make 'Apply Word Wrap' more comfortable

2019-02-27 Thread loh tar
loh.tar edited the summary of this revision.

REPOSITORY
  R39 KTextEditor

REVISION DETAIL
  https://phabricator.kde.org/D17949

To: loh.tar, #ktexteditor, mwolff
Cc: dhaumann, cullmann, mwolff, kwrite-devel, kde-frameworks-devel, 
#ktexteditor, domson, michaelh, ngraham, bruns, demsking, sars


D17949: ViewPrivate: Make 'Apply Word Wrap' more comfortable

2019-02-14 Thread loh tar
loh.tar updated this revision to Diff 51680.
loh.tar edited the summary of this revision.
loh.tar edited the test plan for this revision.
loh.tar set the repository for this revision to R39 KTextEditor.
loh.tar added a comment.


  - Add autotest
  - Don't wrap twice when static wrap is set to avoid bad result

REPOSITORY
  R39 KTextEditor

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D17949?vs=50648=51680

REVISION DETAIL
  https://phabricator.kde.org/D17949

AFFECTED FILES
  autotests/src/katedocument_test.cpp
  autotests/src/katedocument_test.h
  src/document/katedocument.cpp
  src/document/katedocument.h
  src/view/kateview.cpp
  src/view/kateview.h

To: loh.tar, #ktexteditor, mwolff
Cc: dhaumann, cullmann, mwolff, kwrite-devel, kde-frameworks-devel, 
#ktexteditor, gennad, michaelh, ngraham, bruns, demsking, sars


D17949: ViewPrivate: Make 'Apply Word Wrap' more comfortable

2019-02-12 Thread Christoph Cullmann
cullmann added a comment.


  I am ok with the change, but I would like to have one test case in

REVISION DETAIL
  https://phabricator.kde.org/D17949

To: loh.tar, #ktexteditor, mwolff
Cc: dhaumann, cullmann, mwolff, kwrite-devel, kde-frameworks-devel, 
#ktexteditor, gennad, michaelh, ngraham, bruns, demsking, sars


D17949: ViewPrivate: Make 'Apply Word Wrap' more comfortable

2019-02-01 Thread loh tar
loh.tar updated this revision to Diff 50648.
loh.tar added a comment.


  - Move logic into document
  - Tiny docu fix + cosmettic

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D17949?vs=50104=50648

REVISION DETAIL
  https://phabricator.kde.org/D17949

AFFECTED FILES
  src/document/katedocument.cpp
  src/document/katedocument.h
  src/view/kateview.cpp
  src/view/kateview.h

To: loh.tar, #ktexteditor, mwolff
Cc: dhaumann, cullmann, mwolff, kwrite-devel, kde-frameworks-devel, 
#ktexteditor, hase, michaelh, ngraham, bruns, demsking, sars


D17949: ViewPrivate: Make 'Apply Word Wrap' more comfortable

2019-01-25 Thread loh tar
loh.tar added a comment.


  > also don't change the behavior of wordwrapping that is used by the view 
compared to what we would get by calling wordwrap on the document directly
  
  It's somehow not the case. The document has no such function. It's similar to 
ViewPrivate::smartNewline() or ViewPrivate::killLine().
  
  ViewPrivate::applyWordWrap() is (now) like a higher level functionality based 
on two lower level functions.
  
  When everyone want this into the document, I can try to do it. Just give 
advice how exactly. 
  My only idea is to add a new function (e.g. wrapParagraph, reformatLines), 
which will result in an almost empty ViewPrivate::applyWordWrap().

REPOSITORY
  R39 KTextEditor

REVISION DETAIL
  https://phabricator.kde.org/D17949

To: loh.tar, #ktexteditor, mwolff
Cc: dhaumann, cullmann, mwolff, kwrite-devel, kde-frameworks-devel, 
#ktexteditor, hase, michaelh, ngraham, bruns, demsking, sars


D17949: ViewPrivate: Make 'Apply Word Wrap' more comfortable

2019-01-24 Thread Milian Wolff
mwolff requested changes to this revision.
mwolff added a comment.
This revision now requires changes to proceed.


  please look at the existing tests and expand that. There's e.g. 
`KateDocumentTest::testWordWrap` in 
`ktexteditor/autotests/src/katedocument_test.cpp`
  
  also don't change the behavior of wordwrapping that is used by the view 
compared to what we would get by calling wordwrap on the document directly

INLINE COMMENTS

> kateview.cpp:2346
>  {
> -if (selection()) {
> -doc()->wrapText(selectionRange().start().line(), 
> selectionRange().end().line());
> -} else {
> -doc()->wrapText(0, doc()->lastLine());
> +doc()->editStart();
> +int first = selectionRange().start().line();

all of this functionality needs to go into the document, it shouldn't depend on 
the view.

REPOSITORY
  R39 KTextEditor

REVISION DETAIL
  https://phabricator.kde.org/D17949

To: loh.tar, #ktexteditor, mwolff
Cc: dhaumann, cullmann, mwolff, kwrite-devel, kde-frameworks-devel, 
#ktexteditor, hase, michaelh, ngraham, bruns, demsking, sars


D17949: ViewPrivate: Make 'Apply Word Wrap' more comfortable

2019-01-23 Thread loh tar
loh.tar updated this revision to Diff 50104.
loh.tar edited the summary of this revision.
loh.tar set the repository for this revision to R39 KTextEditor.
loh.tar added a comment.


  - Update 'What's This' hint to reflect new behaviour and to be more precise
  - Update 'What's This' hint of dyn wrap too to be more precise
  - Update/clear Summary

REPOSITORY
  R39 KTextEditor

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D17949?vs=50082=50104

REVISION DETAIL
  https://phabricator.kde.org/D17949

AFFECTED FILES
  src/view/kateview.cpp
  src/view/kateview.h

To: loh.tar, #ktexteditor, mwolff
Cc: dhaumann, cullmann, mwolff, kwrite-devel, kde-frameworks-devel, 
#ktexteditor, hase, michaelh, ngraham, bruns, demsking, sars


D17949: ViewPrivate: Make 'Apply Word Wrap' more comfortable

2019-01-22 Thread loh tar
loh.tar updated this revision to Diff 50082.
loh.tar retitled this revision from "ViewPrivate: Make applyWordWrap() more 
comfortable" to "ViewPrivate: Make 'Apply Word Wrap' more comfortable".
loh.tar added a comment.


  - Use std::unique_ptr for the cursor
  - Oops!? Use 'if' instead of unneeded 'while' loop which also avoid 'goto'
  
  Regarding autotest point me to some blue print and I will try to do it.
  
  Should you love it as it is and intend to commit, I would update the summary 
section before and look at that "What this" hint.

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D17949?vs=48639=50082

REVISION DETAIL
  https://phabricator.kde.org/D17949

AFFECTED FILES
  src/view/kateview.cpp
  src/view/kateview.h

To: loh.tar, #ktexteditor, mwolff
Cc: dhaumann, cullmann, mwolff, kwrite-devel, kde-frameworks-devel, 
#ktexteditor, hase, michaelh, ngraham, bruns, demsking, sars