mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 04:27:44 +00:00
Shell: Make SimpleVariable::hit_test_position not hit irrelevant offsets
Without this, any offset would be accepted as being part of the SimpleVariable. Fixes #11976 (by making it no longer crash).
This commit is contained in:
parent
3c1ca61e74
commit
2e333b3571
1 changed files with 3 additions and 0 deletions
|
@ -2843,6 +2843,9 @@ void SimpleVariable::highlight_in_editor(Line::Editor& editor, Shell& shell, Hig
|
||||||
|
|
||||||
HitTestResult SimpleVariable::hit_test_position(size_t offset) const
|
HitTestResult SimpleVariable::hit_test_position(size_t offset) const
|
||||||
{
|
{
|
||||||
|
if (!position().contains(offset))
|
||||||
|
return {};
|
||||||
|
|
||||||
if (m_slice && m_slice->position().contains(offset))
|
if (m_slice && m_slice->position().contains(offset))
|
||||||
return m_slice->hit_test_position(offset);
|
return m_slice->hit_test_position(offset);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue