mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-30 00:31:14 +00:00
LibSQL: Fix off-by-one error in SyntaxHighlighter
This changes the SQL SyntaxHighlighter to conform to the now-fixed rendering of syntax highlighting spans in GUI::TextEditor.
This commit is contained in:
parent
a9378ce5c2
commit
04897f6842
Notes:
sideshowbarker
2024-07-18 16:53:06 +09:00
Author: https://github.com/MaxWipfli Commit: https://github.com/SerenityOS/serenity/commit/04897f6842c Pull-request: https://github.com/SerenityOS/serenity/pull/7768 Issue: https://github.com/SerenityOS/serenity/issues/7349 Reviewed-by: https://github.com/alimpfard
|
@ -52,8 +52,8 @@ void SyntaxHighlighter::rehighlight(Palette const& palette)
|
|||
return;
|
||||
|
||||
GUI::TextPosition position { token.line_number() - 1, token.line_column() - 1 };
|
||||
for (size_t i = 0; i < str.length() - 1; ++i) {
|
||||
if (str[i] == '\n') {
|
||||
for (char c : str) {
|
||||
if (c == '\n') {
|
||||
position.set_line(position.line() + 1);
|
||||
position.set_column(0);
|
||||
} else
|
||||
|
|
Loading…
Reference in a new issue