diff options
Diffstat (limited to 'LiteEditor/navbar.cpp')
-rw-r--r-- | LiteEditor/navbar.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/LiteEditor/navbar.cpp b/LiteEditor/navbar.cpp index eae3ee1a..907a494c 100644 --- a/LiteEditor/navbar.cpp +++ b/LiteEditor/navbar.cpp @@ -31,6 +31,7 @@ #include "navbar.h"
#include "event_notifier.h"
#include "globals.h"
+#include "workspace.h"
NavBar::NavBar(wxWindow* parent)
: NavBarControlBaseClass(parent)
@@ -93,6 +94,13 @@ void NavBar::DoShow(bool s) void NavBar::UpdateScope(TagEntryPtr tag)
{
+ if(!clCxxWorkspaceST::Get()->IsOpen()) {
+ m_tags.clear();
+ m_scope->Clear();
+ m_func->Clear();
+ return;
+ }
+
size_t sel = m_func->GetSelection();
if(tag && sel < m_tags.size() && *m_tags[sel] == *tag) return;
@@ -136,6 +144,8 @@ void NavBar::OnFileSaved(clCommandEvent& e) void NavBar::DoPopulateTags(const wxFileName& fn)
{
+ if(!clCxxWorkspaceST::Get()->IsOpen()) return;
+
std::vector<wxString> scopes;
TagsManagerST::Get()->GetScopesFromFile(fn, scopes);
@@ -160,6 +170,8 @@ void NavBar::DoPopulateTags(const wxFileName& fn) void NavBar::OnEditorChanged(wxCommandEvent& e)
{
e.Skip();
+ if(!clCxxWorkspaceST::Get()->IsOpen()) return;
+
IEditor* editor = ::clGetManager()->GetActiveEditor();
CHECK_PTR_RET(editor);
@@ -169,6 +181,8 @@ void NavBar::OnEditorChanged(wxCommandEvent& e) void NavBar::DoPopulateFunctions(const wxFileName& fn, const wxString& scope)
{
+ if(!clCxxWorkspaceST::Get()->IsOpen()) return;
+
m_tags.clear();
TagsManagerST::Get()->TagsFromFileAndScope(fn, scope, m_tags);
|