Mercurial > octave
changeset 29715:82e45c11da7d
fix auto completion in default empty script of GUI editor (bug #60689)
* file-editor.cc (file_editor): initialize new data member m_editor_ready
storing whether the editor is ready after startup;
(empty_script): set ready flag at startup, return on non-startup calls
if editor still not ready;
(handle_visibility): just return if editor is not yet ready;
* file-editor.h new data member m_editor_ready
author | Torsten Lilge <ttl-octave@mailbox.org> |
---|---|
date | Sun, 30 May 2021 14:42:36 +0200 |
parents | 6375e8ed2838 |
children | da9c55b3e9fa |
files | libgui/src/m-editor/file-editor.cc libgui/src/m-editor/file-editor.h |
diffstat | 2 files changed, 14 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/libgui/src/m-editor/file-editor.cc Sun May 30 13:57:11 2021 +0200 +++ b/libgui/src/m-editor/file-editor.cc Sun May 30 14:42:36 2021 +0200 @@ -117,6 +117,7 @@ m_closed = false; m_no_focus = false; + m_editor_ready = false; m_copy_action_enabled = false; m_undo_action_enabled = false; @@ -255,6 +256,15 @@ // 2. When the editor becomes visible when octave is running void file_editor::empty_script (bool startup, bool visible) { + + if (startup) + m_editor_ready = true; + else + { + if (! m_editor_ready) + return; // not yet ready but got visibility changed signals + } + resource_manager& rmgr = m_octave_qobj.get_resource_manager (); gui_settings *settings = rmgr.get_settings (); if (settings->value (global_use_custom_editor.key, @@ -1461,6 +1471,9 @@ { octave_dock_widget::handle_visibility (visible); + if (! m_editor_ready) + return; + if (m_closed && visible) { m_closed = false;