Bug 384969

Summary: Python indentation problem: function definition inside class is automatically indented inside previous function
Product: [Frameworks and Libraries] frameworks-ktexteditor Reporter: Lucas Pires Camargo <lucaspcamargo>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: mail
Priority: NOR    
Version First Reported In: 5.38.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Lucas Pires Camargo 2017-09-22 18:19:01 UTC
Whenever I have code like this:
'''
class A:

    def a(self):
        print("a")

    def b(self):
'''

Even if I have just pressed shift-Tab to go back an indentation level, as soon as I start writing the definition of function b, it gets indented to be inside function a. The same happens if I correct indentation afterwards, and then correct the line, its indentation level gets bumped up again. This is unbearably annoying.

The menu Tools>Indentation is indeed in "Python" mode. So this might be a Kate bug, dunno.
Comment 1 Sven Brauch 2017-09-22 19:58:02 UTC
Yes, this is a KTextEditor bug, in the Python indenter. I'll move it.
Comment 2 Lucas Pires Camargo 2020-02-04 14:48:15 UTC
This does not happen anymore in recent releases. This bug can be closed I guess.