Bug 339067

Summary: Improper indentation for multi-line if tests in python
Product: [Frameworks and Libraries] frameworks-ktexteditor Reporter: Todd <toddrme2178>
Component: indentationAssignee: KWrite Developers <kwrite-bugs-null>
Status: CONFIRMED ---    
Severity: wishlist CC: aspotashev, christoph, ilmari.lauhakangas, sunwebrw
Priority: NOR    
Version First Reported In: unspecified   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Todd 2014-09-14 12:38:48 UTC
Python code does not correctly indent when using parentheses to create multi-line "if" tests.  In order to make it visually clearer, the second line should be indented one extra level (according to the pep8 module).

This is only an issue with "if" tests, because "if (" is 4 characters.  So "for (", "while (", even "elif (" should not be additionally indented.

Ideally, if it is possible, the indenter could check the number of characters of indentation and do this in any case where such a visual ambiguity could occur, but I don't know if this is possible.

Reproducible: Always


Actual Results:  
if (True == 1 or
    False == 0):
    pass

Expected Results:  
if (True == 1 or
        False == 0):
    pass
Comment 1 Buovjaga 2016-06-25 16:32:43 UTC
Repro.

Arch Linux 64-bit
Kate 16.04.2
KDE Frameworks 5.23.0
Qt 5.7
xcb wm