fix indent/unindent with Tab key for case when several lines selected: issue 22 in dlangide

This commit is contained in:
Vadim Lopatin 2015-02-12 21:43:36 +03:00
parent 37a5072955
commit dabc76390b
1 changed files with 4 additions and 6 deletions

View File

@ -878,10 +878,8 @@ class EditWidgetBase : ScrollWidgetBase, EditableContentListener, MenuItemAction
}
/// returns true if one or more lines selected fully
protected bool wholeLinesSelected() {
return _selectionRange.end.line > _selectionRange.start.line
&& _selectionRange.end.pos == 0
&& _selectionRange.start.pos == 0;
protected bool multipleLinesSelected() {
return _selectionRange.end.line > _selectionRange.start.line;
}
protected bool _camelCasePartsAsWords = true;
@ -1157,7 +1155,7 @@ class EditWidgetBase : ScrollWidgetBase, EditableContentListener, MenuItemAction
_content.performOperation(op, this);
}
} else {
if (wholeLinesSelected()) {
if (multipleLinesSelected()) {
// indent range
return handleAction(new Action(EditorActions.Indent));
} else {
@ -1188,7 +1186,7 @@ class EditWidgetBase : ScrollWidgetBase, EditableContentListener, MenuItemAction
_content.performOperation(op, this);
}
} else {
if (wholeLinesSelected()) {
if (multipleLinesSelected()) {
// unindent range
return handleAction(new Action(EditorActions.Unindent));
} else {