Bug 142655 - Python indent mode doesn't unindent pass correctly with tabs
Summary: Python indent mode doesn't unindent pass correctly with tabs
Status: RESOLVED WORKSFORME
Alias: None
Product: kate
Classification: Applications
Component: general (other bugs)
Version First Reported In: unspecified
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-03-07 18:31 UTC by Yuriy Kozlov
Modified: 2008-07-08 22:45 UTC (History)
1 user (show)

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


Attachments
Possible fix for wrong indentation (556 bytes, patch)
2007-03-09 12:07 UTC, Dominik Haumann
Details

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