mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:07:35 +00:00
LibGUI: Fix off-by-one error in Lexer tokens
This changes the INI and GML lexers to conform to the now-fixed rendering of syntax highlighting spans in GUI::TextEditor. The other user of GMLToken::m_end, GMLAutocompleteProvider, has been modified to take into account that end position columns have been incremented by one.
This commit is contained in:
parent
e7b5dbe1ac
commit
cb5a50d3f7
5 changed files with 6 additions and 10 deletions
|
@ -26,7 +26,6 @@ char IniLexer::consume()
|
|||
{
|
||||
VERIFY(m_index < m_input.length());
|
||||
char ch = m_input[m_index++];
|
||||
m_previous_position = m_position;
|
||||
if (ch == '\n') {
|
||||
m_position.line++;
|
||||
m_position.column = 0;
|
||||
|
@ -47,9 +46,9 @@ Vector<IniToken> IniLexer::lex()
|
|||
IniToken token;
|
||||
token.m_type = type;
|
||||
token.m_start = m_position;
|
||||
consume();
|
||||
token.m_end = m_position;
|
||||
tokens.append(token);
|
||||
consume();
|
||||
};
|
||||
|
||||
auto begin_token = [&] {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue