Bug 142655

Summary: Python indent mode doesn't unindent pass correctly with tabs
Product: [Applications] kate Reporter: Yuriy Kozlov <yuriy.kozlov>
Component: generalAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED WORKSFORME    
Severity: normal CC: esigra
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: Possible fix for wrong indentation

Description Yuriy Kozlov 2007-03-07 18:31:01 UTC
Version:            (using KDE KDE 3.5.6)
Installed from:    Ubuntu Packages
OS:                Linux

Minor bug:
When using Python indentation and tabs, Kate doesn't unindent the "pass" statement correctly.  It creates a space at the beginning of the next line.

1. Create a new document (File -> New). This must be done first, as Kate does not automatically apply indentation settings to new files (already filed a bug on this).

2. Go to Settings -> Configure Kate -> Editor -> Indentation and configure things as follows:

    Automatic Indentation:
        Indentation mode: Python Style (may be overridden by filetype)
    Indentation with Spaces:
        Use spaces instead of tabs to indent: Off (unchecked)

3. Type the following (note that the words in <angled brackets> are keys you should press, and should not be typed verbatim):

    class asdf: <return>
    pass <return>

After pressing <return> the first time, a tab is inserted at the beginning of the next line. After the second time pressing <return> (after "pass"), the correct behavior would be to remove the tab and leave the following line unindented. Instead, Kate indents the next line with a single space. I have tried this more tabs and it converted each tab into a space on the following line, but I have been unable to reliably reproduce the effect with multiple tabs.

Using Kubuntu Feisty with KDE 3.5.6
Originally reported here: https://bugs.launchpad.net/ubuntu/+source/kdebase/+bug/71270
Comment 1 Dominik Haumann 2007-03-09 12:07:49 UTC
Created attachment 19918 [details]
Possible fix for wrong indentation

Can someone with python knowledge confirm the patch?
Comment 2 Dominik Haumann 2007-03-09 12:16:15 UTC
The patch does not unindent the next line, but it fixes the issue with the two spaces, i.e. two tabs are inserted again.
Comment 3 Paul Worrall 2008-07-08 22:34:40 UTC
Unable to reproduce with kate 3.0.83 from KDE 4.1 Beta 2
Comment 4 Yuriy Kozlov 2008-07-08 22:45:53 UTC
Can't reproduce on 4.1 either.