mirror of
https://github.com/RGBCube/serenity
synced 2025-06-29 03:52:12 +00:00
LibGUI: Add TextEditor::force_rehighlight() method
This commit is contained in:
parent
22f835332a
commit
10d75d7f21
2 changed files with 12 additions and 0 deletions
|
@ -1902,6 +1902,11 @@ void TextEditor::rehighlight_if_needed()
|
||||||
{
|
{
|
||||||
if (!m_needs_rehighlight)
|
if (!m_needs_rehighlight)
|
||||||
return;
|
return;
|
||||||
|
force_rehighlight();
|
||||||
|
}
|
||||||
|
|
||||||
|
void TextEditor::force_rehighlight()
|
||||||
|
{
|
||||||
if (m_highlighter)
|
if (m_highlighter)
|
||||||
m_highlighter->rehighlight(palette());
|
m_highlighter->rehighlight(palette());
|
||||||
m_needs_rehighlight = false;
|
m_needs_rehighlight = false;
|
||||||
|
@ -1912,6 +1917,11 @@ Syntax::Highlighter const* TextEditor::syntax_highlighter() const
|
||||||
return m_highlighter.ptr();
|
return m_highlighter.ptr();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Syntax::Highlighter* TextEditor::syntax_highlighter()
|
||||||
|
{
|
||||||
|
return m_highlighter.ptr();
|
||||||
|
}
|
||||||
|
|
||||||
void TextEditor::set_syntax_highlighter(OwnPtr<Syntax::Highlighter> highlighter)
|
void TextEditor::set_syntax_highlighter(OwnPtr<Syntax::Highlighter> highlighter)
|
||||||
{
|
{
|
||||||
if (m_highlighter)
|
if (m_highlighter)
|
||||||
|
|
|
@ -175,6 +175,7 @@ public:
|
||||||
void set_cursor(size_t line, size_t column);
|
void set_cursor(size_t line, size_t column);
|
||||||
virtual void set_cursor(TextPosition const&);
|
virtual void set_cursor(TextPosition const&);
|
||||||
|
|
||||||
|
Syntax::Highlighter* syntax_highlighter();
|
||||||
Syntax::Highlighter const* syntax_highlighter() const;
|
Syntax::Highlighter const* syntax_highlighter() const;
|
||||||
void set_syntax_highlighter(OwnPtr<Syntax::Highlighter>);
|
void set_syntax_highlighter(OwnPtr<Syntax::Highlighter>);
|
||||||
|
|
||||||
|
@ -209,6 +210,7 @@ public:
|
||||||
|
|
||||||
bool text_is_secret() const { return m_text_is_secret; }
|
bool text_is_secret() const { return m_text_is_secret; }
|
||||||
void set_text_is_secret(bool text_is_secret);
|
void set_text_is_secret(bool text_is_secret);
|
||||||
|
void force_rehighlight();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
explicit TextEditor(Type = Type::MultiLine);
|
explicit TextEditor(Type = Type::MultiLine);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue