Bug 436480 - Deleting folded lines does not remove code folding marker
Summary: Deleting folded lines does not remove code folding marker
Status: RESOLVED FIXED
Alias: None
Product: frameworks-ktexteditor
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: 5.81.0
Platform: Other Other
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-02 05:16 UTC by Kishore Gopalakrishnan
Modified: 2022-08-10 20:07 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Screenshot showing observed result after step 4 (62.69 KB, image/png)
2021-05-02 05:16 UTC, Kishore Gopalakrishnan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Kishore Gopalakrishnan 2021-05-02 05:16:29 UTC
Created attachment 138072 [details]
Screenshot showing observed result after step 4

SUMMARY
When you delete a set of folded lines, the code folding marker is wrongly shown even if the entire folded environment is removed.

STEPS TO REPRODUCE
1. Create a file with a foldable environment (e.g., the following file, blah.py; numbers like L1, L2, ... at the beginning denote line numbers). You will have to save the file.
```
L1 | print("pre-blah")
L2 |
L3 | def f(x):
L4 | 	a = 1+2
L5 | 	b = 2+3
L6 | 	return a+b
L7 | 
L8 | print("blah")
```
2. Fold the definition of f(x) by clicking on the code folding arrow that appears in L3.
3. Select lines L2-L7 with the mouse
4. Press Ctrl+K (to delete lines)

OBSERVED RESULTS
A 'folded code' marker is shown on the line containing the second print statement (see attached screenshot). Clicking on the code folding marker makes it disappear.

EXPECTED RESULTS
If a folded block of code is deleted, the code folding marker should also be removed immediately.

SOFTWARE/OS VERSIONS
Operating System: Arch Linux
KDE Plasma Version: 5.21.4
KDE Frameworks Version: 5.81.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION
I was able to reproduce this in both Kile and Kate, so I am reporting this under ktexteditor.
Comment 1 Bug Janitor Service 2022-08-10 16:48:44 UTC
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/ktexteditor/-/merge_requests/399
Comment 2 Christoph Cullmann 2022-08-10 20:07:54 UTC
Git commit 28d9cbc32fdda5ced60626c0487dd69c7f5a8b49 by Christoph Cullmann, on behalf of Waqar Ahmed.
Committed on 10/08/2022 at 20:02.
Pushed by cullmann into branch 'master'.

Update folding ranges on text modification

M  +28   -0    src/buffer/katetextfolding.cpp
M  +2    -0    src/buffer/katetextfolding.h
M  +1    -0    src/view/kateview.cpp

https://invent.kde.org/frameworks/ktexteditor/commit/28d9cbc32fdda5ced60626c0487dd69c7f5a8b49