mirror of https://github.com/buggins/dlangui.git
fix indent/unindent with Tab key for case when several lines selected: issue 22 in dlangide
This commit is contained in:
parent
37a5072955
commit
dabc76390b
|
@ -878,10 +878,8 @@ class EditWidgetBase : ScrollWidgetBase, EditableContentListener, MenuItemAction
|
||||||
}
|
}
|
||||||
|
|
||||||
/// returns true if one or more lines selected fully
|
/// returns true if one or more lines selected fully
|
||||||
protected bool wholeLinesSelected() {
|
protected bool multipleLinesSelected() {
|
||||||
return _selectionRange.end.line > _selectionRange.start.line
|
return _selectionRange.end.line > _selectionRange.start.line;
|
||||||
&& _selectionRange.end.pos == 0
|
|
||||||
&& _selectionRange.start.pos == 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected bool _camelCasePartsAsWords = true;
|
protected bool _camelCasePartsAsWords = true;
|
||||||
|
@ -1157,7 +1155,7 @@ class EditWidgetBase : ScrollWidgetBase, EditableContentListener, MenuItemAction
|
||||||
_content.performOperation(op, this);
|
_content.performOperation(op, this);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (wholeLinesSelected()) {
|
if (multipleLinesSelected()) {
|
||||||
// indent range
|
// indent range
|
||||||
return handleAction(new Action(EditorActions.Indent));
|
return handleAction(new Action(EditorActions.Indent));
|
||||||
} else {
|
} else {
|
||||||
|
@ -1188,7 +1186,7 @@ class EditWidgetBase : ScrollWidgetBase, EditableContentListener, MenuItemAction
|
||||||
_content.performOperation(op, this);
|
_content.performOperation(op, this);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (wholeLinesSelected()) {
|
if (multipleLinesSelected()) {
|
||||||
// unindent range
|
// unindent range
|
||||||
return handleAction(new Action(EditorActions.Unindent));
|
return handleAction(new Action(EditorActions.Unindent));
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue