update editor actions

This commit is contained in:
Vadim Lopatin 2015-02-08 21:23:15 +03:00
parent f9bef62e65
commit 1cf381e4b9
1 changed files with 6 additions and 2 deletions

View File

@ -410,11 +410,11 @@ class EditWidgetBase : ScrollWidgetBase, EditableContentListener, MenuItemAction
override bool isActionEnabled(const Action action) { override bool isActionEnabled(const Action action) {
switch (action.id) { switch (action.id) {
case EditorActions.ToggleBlockComment: case EditorActions.ToggleBlockComment:
return !_selectionRange.empty; return enabled && !_selectionRange.empty;
case EditorActions.ToggleLineComment: case EditorActions.ToggleLineComment:
case EditorActions.Tab: case EditorActions.Tab:
case EditorActions.BackTab: case EditorActions.BackTab:
return true; return enabled;
case EditorActions.Copy: case EditorActions.Copy:
return !_selectionRange.empty; return !_selectionRange.empty;
case EditorActions.Cut: case EditorActions.Cut:
@ -906,6 +906,10 @@ class EditWidgetBase : ScrollWidgetBase, EditableContentListener, MenuItemAction
case EditorActions.Paste: case EditorActions.Paste:
case EditorActions.Undo: case EditorActions.Undo:
case EditorActions.Redo: case EditorActions.Redo:
case EditorActions.ToggleBlockComment:
case EditorActions.ToggleLineComment:
case EditorActions.Tab:
case EditorActions.BackTab:
if (isActionEnabled(a)) if (isActionEnabled(a))
a.state = ACTION_STATE_ENABLED; a.state = ACTION_STATE_ENABLED;
else else