mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-853
Back space action should respect indentation settings in non empty lines
This commit is contained in:
@@ -326,6 +326,6 @@
|
||||
text="Run Django Console..." description="Allows to quickly run Django console">
|
||||
<add-to-group group-id="ToolsMenu" anchor="last"/>
|
||||
</action>
|
||||
<action id="Console.Python.Execute" class="com.intellij.openapi.actionSystem.EmptyAction" text="Execute Current Statement"/>
|
||||
<action id="Console.Execute" class="com.intellij.openapi.actionSystem.EmptyAction" text="Execute Current Statement"/>
|
||||
</actions>
|
||||
</idea-plugin>
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
class Foo(object):
|
||||
def foo(bar):
|
||||
pass
|
||||
@@ -0,0 +1,3 @@
|
||||
class Foo(object):
|
||||
def foo(bar):
|
||||
pass
|
||||
Reference in New Issue
Block a user