IDEA-167630 Backspace > Unindent to nearest indent position option doesn't work as expected at empty line

This commit is contained in:
Dmitry Batrak
2017-02-06 13:20:56 +03:00
parent a695533a24
commit 79edeb9083
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2015 JetBrains s.r.o.
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -203,6 +203,7 @@ public class BackspaceHandler extends EditorWriteActionHandler {
int offset = editor.getCaretModel().getOffset();
editor.getSelectionModel().setSelection(targetOffset, offset);
EditorModificationUtil.deleteSelectedText(editor);
editor.getCaretModel().moveToLogicalPosition(pos);
}
else if (pos.column > logicalPosition.column) {
EditorModificationUtil.insertStringAtCaret(editor, StringUtil.repeatSymbol(' ', pos.column - logicalPosition.column));