diff --git a/python/src/META-INF/python-plugin-common.xml b/python/src/META-INF/python-plugin-common.xml index 03c5501bd1d2..9e324dfe1dd4 100644 --- a/python/src/META-INF/python-plugin-common.xml +++ b/python/src/META-INF/python-plugin-common.xml @@ -326,6 +326,6 @@ text="Run Django Console..." description="Allows to quickly run Django console"> - + diff --git a/python/src/com/jetbrains/python/editor/PythonBackspaceHandler.java b/python/src/com/jetbrains/python/editor/PythonBackspaceHandler.java index 8b83e8111923..256cc5605dc6 100644 --- a/python/src/com/jetbrains/python/editor/PythonBackspaceHandler.java +++ b/python/src/com/jetbrains/python/editor/PythonBackspaceHandler.java @@ -23,14 +23,8 @@ public class PythonBackspaceHandler extends BackspaceHandlerDelegate { if (myTargetPosition != null) { // Remove all the following spaces before moving to targetPosition final int offset = editor.getCaretModel().getOffset(); - if (EditorModificationUtil.calcAfterLineEnd(editor) == 0) { - int delta = editor.getCaretModel().getVisualPosition().column - myTargetPosition.column; - assert delta >= 0; - if (offset <= editor.getDocument().getTextLength()) { - editor.getSelectionModel().setSelection(offset - delta, offset); - EditorModificationUtil.deleteSelectedText(editor); - } - } + editor.getSelectionModel().setSelection(offset - editor.getCaretModel().getVisualPosition().column + myTargetPosition.column, offset); + EditorModificationUtil.deleteSelectedText(editor); editor.getCaretModel().moveToLogicalPosition(myTargetPosition); myTargetPosition = null; return true; diff --git a/python/testData/editing/smartUnindent.after.py b/python/testData/editing/smartUnindent.after.py new file mode 100644 index 000000000000..44728335e4d1 --- /dev/null +++ b/python/testData/editing/smartUnindent.after.py @@ -0,0 +1,3 @@ +class Foo(object): +def foo(bar): + pass diff --git a/python/testData/editing/smartUnindent.before.py b/python/testData/editing/smartUnindent.before.py new file mode 100644 index 000000000000..f5f92d75a7e9 --- /dev/null +++ b/python/testData/editing/smartUnindent.before.py @@ -0,0 +1,3 @@ +class Foo(object): + def foo(bar): + pass