Ensure highlighted folding marker after unfold
ClosedPublic

Authored by loh.tar on Apr 25 2019, 2:22 PM.

Details

Summary

With this patch behaves the unfold like the fold to highlight the start and end marker

  • Remove unneeded delete
Test Plan

autotest looks good :-S

Compare what happens when unfold like this

Diff Detail

Repository
R39 KTextEditor
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
loh.tar created this revision.Apr 25 2019, 2:22 PM
Restricted Application added projects: Kate, Frameworks. · View Herald TranscriptApr 25 2019, 2:22 PM
Restricted Application added subscribers: kde-frameworks-devel, kwrite-devel. · View Herald Transcript
loh.tar requested review of this revision.Apr 25 2019, 2:22 PM

I think about a patch to issue the foldingPreview in case of unfold when done by click on the icon bar. Unfortunately would that need some bigger changes at the toggleFolding functions to return what was done.

Oops! Noticed that we have now some odd behavior when issued the toggle child action, will take a look.

loh.tar updated this revision to Diff 56977.Apr 25 2019, 3:10 PM
  • Ensure cursor don't move when isssue toggleFoldingsInRange
loh.tar updated this revision to Diff 57002.Apr 26 2019, 5:15 AM
loh.tar edited the test plan for this revision. (Show Details)
  • Fix jump of big unfold II :-/

I notice that this not yet works when done by Short-Cut/Menu and there are nested folding ranges

I must confess, I am a bit confused what this patch should improve.
Could you tell again which concrete issue it fixes?
And why is the delete not useful?

Ok, I see, I tried it a bit more and yes, now the folding start/end tokens are highlighted on unfold.
Btw., is it intentional that the folding start/end tokens are only sometimes highlighted on folding, still?

e.g. not for the

if (trueValues.contains(val)) {
    *result = true;
    return true;
}

case?

And why is the delete not useful?

After one month, no idea on first sight, sorry. Guess it is deleted prior or later anyway/already.

is it intentional that the folding start/end tokens are only sometimes highlighted on folding, still?

I don't think so, no. But can't reproduce the given example. Looks working here.

OTH Seems my stated "With this patch behaves the unfold like the fold to highlight the start and end marker" only valid when fold by Short-Cut and not by mouse click on the left border.

So, compare where the cursor is when click on the left border. Without patch on pos 0 (first column), with patch just before the open brace.

I was often slightly irritated when unfold something. "What exact was now unfold?" The text jumps to quickly. A soft, fluid animation may nice, but not so easy to do. So I came up with this idea.

cullmann accepted this revision.May 23 2019, 1:39 PM

Hmm, I am fine with the change beside with the delete m_foldingPreview;, I think that is there to ensure the preview is directly hidden if one toggles a folding.
It will be later deleted by the leave of the bar but I don't think the earlier delete hurts.
Please keep that, if there is no strong reason to remove it and push that, thanks.

This revision is now accepted and ready to land.May 23 2019, 1:39 PM
This revision was automatically updated to reflect the committed changes.