mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:17:44 +00:00
Spreadsheet: Prevent OOB access to text editor buffer
For some reason LibGUI sends two events for each edit, and one of them contains an OOB cursor if a character was deleted. This works around that for now.
This commit is contained in:
parent
b691269912
commit
0e2f4c50d3
1 changed files with 1 additions and 0 deletions
|
@ -383,6 +383,7 @@ void SpreadsheetWidget::try_generate_tip_for_input_expression(StringView source,
|
||||||
m_inline_documentation_window->hide();
|
m_inline_documentation_window->hide();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
cursor_offset = min(cursor_offset, source.length());
|
||||||
auto maybe_function_and_argument = get_function_and_argument_index(source.substring_view(0, cursor_offset));
|
auto maybe_function_and_argument = get_function_and_argument_index(source.substring_view(0, cursor_offset));
|
||||||
if (!maybe_function_and_argument.has_value()) {
|
if (!maybe_function_and_argument.has_value()) {
|
||||||
m_inline_documentation_window->hide();
|
m_inline_documentation_window->hide();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue