mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-02 06:37:52 +00:00
Shell: Fix closest command node detection in Pipes and Sequences
This makes --option completions work for pipes and sequences too.
This commit is contained in:
committed by
Andreas Kling
parent
a9cee8ee02
commit
7f3e1fa826
@@ -1617,10 +1617,16 @@ HitTestResult Pipe::hit_test_position(size_t offset)
|
||||
return {};
|
||||
|
||||
auto result = m_left->hit_test_position(offset);
|
||||
if (result.matching_node)
|
||||
if (result.matching_node) {
|
||||
if (!result.closest_command_node)
|
||||
result.closest_command_node = m_right;
|
||||
return result;
|
||||
}
|
||||
|
||||
return m_right->hit_test_position(offset);
|
||||
result = m_right->hit_test_position(offset);
|
||||
if (!result.closest_command_node)
|
||||
result.closest_command_node = m_right;
|
||||
return result;
|
||||
}
|
||||
|
||||
Pipe::Pipe(Position position, NonnullRefPtr<Node> left, NonnullRefPtr<Node> right)
|
||||
@@ -1801,9 +1807,16 @@ HitTestResult Sequence::hit_test_position(size_t offset)
|
||||
return {};
|
||||
|
||||
auto result = m_left->hit_test_position(offset);
|
||||
if (result.matching_node)
|
||||
if (result.matching_node) {
|
||||
if (!result.closest_command_node)
|
||||
result.closest_command_node = m_right;
|
||||
return result;
|
||||
return m_right->hit_test_position(offset);
|
||||
}
|
||||
|
||||
result = m_right->hit_test_position(offset);
|
||||
if (!result.closest_command_node)
|
||||
result.closest_command_node = m_right;
|
||||
return result;
|
||||
}
|
||||
|
||||
Sequence::Sequence(Position position, NonnullRefPtr<Node> left, NonnullRefPtr<Node> right, Position separator_position)
|
||||
|
||||
Reference in New Issue
Block a user