mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-23 08:57:28 +00:00
Shell: Fix completing barewords with escapes
e.g. completing `foo\ bar` now works as expected.
This commit is contained in:
committed by
Andreas Kling
parent
7059ca9b15
commit
9523bcbfe1
@@ -232,8 +232,8 @@ Vector<Line::CompletionSuggestion> Node::complete_for_editor(Shell& shell, size_
|
||||
auto matching_node = hit_test_result.matching_node;
|
||||
if (matching_node) {
|
||||
if (matching_node->is_bareword()) {
|
||||
auto corrected_offset = offset - matching_node->position().start_offset;
|
||||
auto* node = static_cast<BarewordLiteral*>(matching_node.ptr());
|
||||
auto corrected_offset = find_offset_into_node(node->text(), offset - matching_node->position().start_offset);
|
||||
|
||||
if (corrected_offset > node->text().length())
|
||||
return {};
|
||||
|
||||
Reference in New Issue
Block a user