D20606: Toggle folding of child ranges by right click

2019-04-17 Thread Christoph Cullmann
cullmann requested changes to this revision.
cullmann added a comment.
This revision now requires changes to proceed.


  The question is: with a context menu, isn't that then already too 
inconvenient? 
  At the moment we have no context menu for the bar at all.
  I could live with the right click for the moment, we can still enhance that, 
if we add further "actions".
  But I think we need at least an action in the "Code Foldings" sub-menu that 
does trigger this for the current active folding region.
  If that is there, more can follow in extra changes, I think.

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

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


D20606: Toggle folding of child ranges by right click

2019-04-17 Thread loh tar
loh.tar added a comment.


  hm, there is already a folding action in the View menu. 
  I understood Dominik so, not to add a context menu to the icon border, but to 
add the action to the context menu of the "edit range".
  Whatever, as said I'm not in the mood for that,  and it should be done in a 
2nd patch, when needed.
  But a context menu on the icon border would I very much dislike. Middle click 
is not so handy and perform atm "paste to begin of line"

INLINE COMMENTS

> kateviewhelpers.cpp:2484
> +// Don't try to fold a single line, which can happens due to adjustment 
> above'
> +// FIXME Avoid to offer a such folding marker
> +if (!foldingRange.onSingleLine()) {

oops, "to offer such a folding"

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

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


D20606: Toggle folding of child ranges by right click

2019-04-17 Thread loh tar
loh.tar updated this revision to Diff 56444.
loh.tar added a comment.


  - Add docu to header, not full happy with
  - Add desired adjustment checks
  - Make toggleFoldingInRange more action friendly
- Add first try to unfold range itself into toggleFoldingInRange
- Be a smart ass, minimize if nesting in mouseReleaseEvent
  - Fix to eager toggleFoldingInRange, don't fold else part when written on one 
line } else {
  
  Regading toggleFoldingInRange
  
  - The return value is not needed anymore and will only in rare cases say 
"false"
  - Should now be useable as slot, so remove the return value?
  - Better name idea?

CHANGES SINCE LAST UPDATE
  https://phabricator.kde.org/D20606?vs=56375=56444

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

AFFECTED FILES
  src/view/kateviewhelpers.cpp
  src/view/kateviewhelpers.h
  src/view/kateviewinternal.cpp

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


D20606: Toggle folding of child ranges by right click

2019-04-17 Thread Milian Wolff
mwolff added a comment.


  In D20606#451459 , @dhaumann wrote:
  
  > I would prefer a context menu that has this as action. This is much better 
discoverable and also extensible with more folding actions.
  
  
  I agree. Right-click should show a context menu. Middle-click could toggle, 
if you need it.

REPOSITORY
  R39 KTextEditor

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

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


D20606: Toggle folding of child ranges by right click

2019-04-16 Thread Dominik Haumann
dhaumann added a comment.


  I would prefer a context menu that has this as action. This is much better 
discoverable and also extensible with more folding actions.

REPOSITORY
  R39 KTextEditor

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

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


D20606: Toggle folding of child ranges by right click

2019-04-16 Thread Christoph Cullmann
cullmann added reviewers: ngraham, dhaumann.
cullmann added a comment.


  I think the feature is nice.
  
  For the code: I would like to have comments for the function decls. to tell 
what they really do.
  e.g. toggleFoldingInRange needs a short summary what it does, the comments in 
the function themself are helpful.
  
  Others, feedback?
  
  The only real issue for the "usability" is imho the lack of discoverability.
  Perhaps this should in addition get an action in the "Code Folding" menu?
  The people can have a shortcut for it, too, if wanted.

REPOSITORY
  R39 KTextEditor

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

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


D20606: Toggle folding of child ranges by right click

2019-04-16 Thread loh tar
loh.tar added a comment.


  Oh, may that fit too?
  Bug 352868 - Folding for all nodes (not just top-level) and/or siblings to 
current

REPOSITORY
  R39 KTextEditor

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

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


D20606: Toggle folding of child ranges by right click

2019-04-16 Thread loh tar
loh.tar added a comment.


  A possible improvement could be to add slots to make the folding accessible 
by some keyboard action, but I'm not in the mood for that now.
  Bug 343060 - global folding code keyboard shortcuts

REPOSITORY
  R39 KTextEditor

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

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


D20606: Toggle folding of child ranges by right click

2019-04-16 Thread loh tar
loh.tar added a comment.


  This patch supersedes D20565 

REPOSITORY
  R39 KTextEditor

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

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


D20606: Toggle folding of child ranges by right click

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

REVISION SUMMARY
  With this patch will all, and only, the nested foldings of a range
  (un)folded by right mouse click on the left hand icon border.
  
  The range itself keep untouched, not toggled.
  
  For convenience toggle the right button also a range which doesn't
  contain other folding ranges.
  
  The noted bug report request a slightly different behavior, but I think
  it's close enough to considered that as "fixed".
  
  BUG: 344414
  FIXED-IN: 5.58

REPOSITORY
  R39 KTextEditor

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

AFFECTED FILES
  src/view/kateviewhelpers.cpp
  src/view/kateviewhelpers.h
  src/view/kateviewinternal.cpp

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