mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 18:07:35 +00:00
HackStudio: Don't parse documentation if already parsed
This commit is contained in:
parent
77f3c12dc9
commit
4d3be45ff4
2 changed files with 7 additions and 0 deletions
|
@ -94,6 +94,10 @@ void Editor::show_documentation_tooltip_if_available(const String& hovered_token
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_documentation_tooltip_window->is_visible() && hovered_token == m_last_parsed_token) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
dbg() << "opening " << it->value;
|
dbg() << "opening " << it->value;
|
||||||
auto file = CFile::construct(it->value);
|
auto file = CFile::construct(it->value);
|
||||||
if (!file->open(CFile::ReadOnly)) {
|
if (!file->open(CFile::ReadOnly)) {
|
||||||
|
@ -129,6 +133,8 @@ void Editor::show_documentation_tooltip_if_available(const String& hovered_token
|
||||||
m_documentation_html_view->set_document(html_document);
|
m_documentation_html_view->set_document(html_document);
|
||||||
m_documentation_tooltip_window->move_to(screen_location.translated(4, 4));
|
m_documentation_tooltip_window->move_to(screen_location.translated(4, 4));
|
||||||
m_documentation_tooltip_window->show();
|
m_documentation_tooltip_window->show();
|
||||||
|
|
||||||
|
m_last_parsed_token = hovered_token;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Editor::mousemove_event(GMouseEvent& event)
|
void Editor::mousemove_event(GMouseEvent& event)
|
||||||
|
|
|
@ -27,4 +27,5 @@ private:
|
||||||
|
|
||||||
RefPtr<GWindow> m_documentation_tooltip_window;
|
RefPtr<GWindow> m_documentation_tooltip_window;
|
||||||
RefPtr<HtmlView> m_documentation_html_view;
|
RefPtr<HtmlView> m_documentation_html_view;
|
||||||
|
String m_last_parsed_token;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue