From dabc76390b32458c2422959cfdc6364b468299f0 Mon Sep 17 00:00:00 2001 From: Vadim Lopatin Date: Thu, 12 Feb 2015 21:43:36 +0300 Subject: [PATCH] fix indent/unindent with Tab key for case when several lines selected: issue 22 in dlangide --- src/dlangui/widgets/editors.d | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/dlangui/widgets/editors.d b/src/dlangui/widgets/editors.d index 352ff7db..c37bf84b 100644 --- a/src/dlangui/widgets/editors.d +++ b/src/dlangui/widgets/editors.d @@ -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 {