mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 07:08:10 +00:00
LibLine: Use the correct loop conditions for erase_character_forwards()
Prior to this commit, the loop would continue forever and try to remove the same index every time, eventually hitting a VERIFY and crashing.
This commit is contained in:
parent
a49b7e92eb
commit
8b2beb2ebe
1 changed files with 1 additions and 1 deletions
|
@ -168,7 +168,7 @@ void Editor::erase_character_forwards()
|
||||||
auto end_of_next_grapheme = closest_cursor_left_offset + 1 >= m_cached_buffer_metrics.grapheme_breaks.size()
|
auto end_of_next_grapheme = closest_cursor_left_offset + 1 >= m_cached_buffer_metrics.grapheme_breaks.size()
|
||||||
? m_buffer.size()
|
? m_buffer.size()
|
||||||
: m_cached_buffer_metrics.grapheme_breaks[closest_cursor_left_offset + 1];
|
: m_cached_buffer_metrics.grapheme_breaks[closest_cursor_left_offset + 1];
|
||||||
for (; m_cursor < end_of_next_grapheme;)
|
for (auto cursor = m_cursor; cursor < end_of_next_grapheme; ++cursor)
|
||||||
remove_at_index(m_cursor);
|
remove_at_index(m_cursor);
|
||||||
m_refresh_needed = true;
|
m_refresh_needed = true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue