Bug 463012 - Folding Marker displayed even when folding region too small to fold
Summary: Folding Marker displayed even when folding region too small to fold
Status: RESOLVED DUPLICATE of bug 374570
Alias: None
Product: frameworks-ktexteditor
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 5.101.0
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-12-13 16:04 UTC by chris.m.geroux
Modified: 2024-03-15 20:00 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description chris.m.geroux 2022-12-13 16:04:45 UTC
SUMMARY
During character based folding, fold start markers are identified and displayed for small one-line folding regions, however, they don't actually fold those regions.

STEPS TO REPRODUCE
An example in a c-style language

void myFunction(){
}

This will display a code fold marker (the small triangle icon on the left hand boarder) however, will not actually fold the function.

This probably doesn't come up too much in c-style languages because you probably wouldn't have an empty function. However in python I would expect the following is quite common:

def myFunction():
    ''' Some documentation about my function
    '''

    lines of function that do things ...

The doc string in between the two sets of triple quotes " ''' " will display a code folding marker. In addition a code folding marker will be displayed for the "def myFunction ():" line also. However, the folding marker on the two line doc string will not actually fold that section. More over, trying to click the code fold marker for the doc string will fold the whole body of the function. This can cause a fair amount of confusion about what is going on as the user would likely expect the lower line of the doc string the " ''' " to fold up.

Choosing not to fold small one-line regions like this isn't at all a problem. However, preferably in this case the code fold marker for the region wouldn't be displayed as that region can't actually be folded and a believe that is the desired behaviour.

SOFTWARE/OS VERSIONS
This behaviour was experienced on Ubuntu 22, with Kate version 23.03.70. However, I would expect similar behaviour on any platform.
Comment 1 Christoph Cullmann 2024-03-15 20:00:02 UTC
Hovering over the marker will still highlight the range, therefore I don't think removing them is a good idea.

The issue that the folding folds the wrong range is tracked in bug 374570.

*** This bug has been marked as a duplicate of bug 374570 ***