mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 07:36:50 +00:00
LibSyntax+Userland: Make LibSyntax not depend on LibGUI
This moves some stuff around to make LibGUI depend on LibSyntax instead of the other way around, as not every application that wishes to do syntax highlighting is necessarily a LibGUI (or even a GUI) application.
This commit is contained in:
committed by
Tim Flynn
parent
2495302991
commit
ba4db899d4
@@ -26,9 +26,9 @@ void GitCommitSyntaxHighlighter::rehighlight(Palette const& palette)
|
||||
GitCommitLexer lexer(text);
|
||||
auto tokens = lexer.lex();
|
||||
|
||||
Vector<GUI::TextDocumentSpan> spans;
|
||||
Vector<Syntax::TextDocumentSpan> spans;
|
||||
for (auto& token : tokens) {
|
||||
GUI::TextDocumentSpan span;
|
||||
Syntax::TextDocumentSpan span;
|
||||
span.range.set_start({ token.m_start.line, token.m_start.column });
|
||||
span.range.set_end({ token.m_end.line, token.m_end.column });
|
||||
span.attributes = style_for_token_type(palette, token.m_type);
|
||||
|
||||
Reference in New Issue
Block a user