Bug 384969 - Python indentation problem: function definition inside class is automatically indented inside previous function
Summary: Python indentation problem: function definition inside class is automatically...
Status: RESOLVED FIXED
Alias: None
Product: frameworks-ktexteditor
Classification: Frameworks and Libraries
Component: general (other bugs)
Version First Reported In: 5.38.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-09-22 18:19 UTC by Lucas Pires Camargo
Modified: 2020-02-04 14:48 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.