| Summary: | Crash trying to open a displaced closed folding marker | ||
|---|---|---|---|
| Product: | [Frameworks and Libraries] frameworks-ktexteditor | Reporter: | Jaime Torres <jtamate> |
| Component: | general | Assignee: | KWrite Developers <kwrite-bugs-null> |
| Status: | RESOLVED FIXED | ||
| Severity: | crash | CC: | christoph, mail, waqar.17a |
| Priority: | NOR | Keywords: | drkonqi |
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | openSUSE | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: | Folding gone crazy | ||
|
Description
Jaime Torres
2021-04-11 20:04:27 UTC
This doesn't look related to kdev-python or kdevelop, I'm moving it to KTextEditor. I would like to fix this, but without a proper way to reproduce this, I can't see how I can :( Created attachment 145233 [details]
Folding gone crazy
I've seen how to reproduce it.
Create a trivial python program, for example:
class Test:
# line added
def __init__(self):
a = '''
Some text
'''
def test(self):
# line added
# line added
for i in range(10):
print('hello world')
with open('test.py') as f:
lines = f.read()
fold it in the for loop
save the session and close kate
modify the file with another editor and insert one blank line where there was already one:
class Test:
# line added
def __init__(self):
a = '''
Some text
'''
def test(self):
# line added
# line added
for i in range(10):
print('hello world')
with open('test.py') as f:
lines = f.read()
Open kate and the folding is gone crazy (like in the attached screenshot). But can not easily reproduce the crash.
The the folding does strange stuff after the file was externally modified on restore of the session is clear, it will just restore the ranges in some best effort way, that will not work. But it should not crash and one should be able to unfold the stuff, that works, doesn't it? > But it should not crash and one should be able to unfold the stuff, that works, doesn't it?
Unfortunately is not what I can see with the little file (and bigger ones)..
When I try to unfold the for loop, it folds the method definition and if I unfold the method, the for loop is still folded. Folding and unfolding other parts doesn't help also. I can only see the for loop in the preview of the folded method.
This has been fixed now in the way that Foldings are not restored if the document isn't exactly the same. |