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.
A possibly relevant merge request was started @ https://invent.kde.org/frameworks/ktexteditor/-/merge_requests/399
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