ScriptEditor: Fixes bug where menu option would be handled twice

This commit is contained in:
Ignacio Etcheverry 2017-04-17 02:41:24 +02:00
parent e55a496f79
commit 97c385dbb8
1 changed files with 20 additions and 19 deletions

View File

@ -878,28 +878,29 @@ void ScriptEditor::_menu_option(int p_option) {
} }
} }
} }
} } else {
EditorHelp *help = tab_container->get_current_tab_control()->cast_to<EditorHelp>(); EditorHelp *help = tab_container->get_current_tab_control()->cast_to<EditorHelp>();
if (help) { if (help) {
switch (p_option) { switch (p_option) {
case HELP_SEARCH_FIND: { case HELP_SEARCH_FIND: {
help->popup_search(); help->popup_search();
} break; } break;
case HELP_SEARCH_FIND_NEXT: { case HELP_SEARCH_FIND_NEXT: {
help->search_again(); help->search_again();
} break; } break;
case FILE_CLOSE: { case FILE_CLOSE: {
_close_current_tab(); _close_current_tab();
} break; } break;
case CLOSE_DOCS: { case CLOSE_DOCS: {
_close_docs_tab(); _close_docs_tab();
} break; } break;
case CLOSE_ALL: { case CLOSE_ALL: {
_close_all_tabs(); _close_all_tabs();
} break; } break;
}
} }
} }
} }