diff options
Diffstat (limited to 'Userland/Libraries')
-rw-r--r-- | Userland/Libraries/LibGUI/TextEditor.cpp | 10 | ||||
-rw-r--r-- | Userland/Libraries/LibGUI/TextEditor.h | 2 |
2 files changed, 12 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGUI/TextEditor.cpp b/Userland/Libraries/LibGUI/TextEditor.cpp index 0aeae17aa7..ca30ca3dee 100644 --- a/Userland/Libraries/LibGUI/TextEditor.cpp +++ b/Userland/Libraries/LibGUI/TextEditor.cpp @@ -1902,6 +1902,11 @@ void TextEditor::rehighlight_if_needed() { if (!m_needs_rehighlight) return; + force_rehighlight(); +} + +void TextEditor::force_rehighlight() +{ if (m_highlighter) m_highlighter->rehighlight(palette()); m_needs_rehighlight = false; @@ -1912,6 +1917,11 @@ Syntax::Highlighter const* TextEditor::syntax_highlighter() const return m_highlighter.ptr(); } +Syntax::Highlighter* TextEditor::syntax_highlighter() +{ + return m_highlighter.ptr(); +} + void TextEditor::set_syntax_highlighter(OwnPtr<Syntax::Highlighter> highlighter) { if (m_highlighter) diff --git a/Userland/Libraries/LibGUI/TextEditor.h b/Userland/Libraries/LibGUI/TextEditor.h index 937638bb3d..e42e00b228 100644 --- a/Userland/Libraries/LibGUI/TextEditor.h +++ b/Userland/Libraries/LibGUI/TextEditor.h @@ -175,6 +175,7 @@ public: void set_cursor(size_t line, size_t column); virtual void set_cursor(TextPosition const&); + Syntax::Highlighter* syntax_highlighter(); Syntax::Highlighter const* syntax_highlighter() const; void set_syntax_highlighter(OwnPtr<Syntax::Highlighter>); @@ -209,6 +210,7 @@ public: bool text_is_secret() const { return m_text_is_secret; } void set_text_is_secret(bool text_is_secret); + void force_rehighlight(); protected: explicit TextEditor(Type = Type::MultiLine); |