1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:27:35 +00:00

LibLine: Respect the provided completion static offset

Now that we can resolve these correctly and they're per-suggestion, we
can finally use them for their intended purpose of letting suggestions
overwrite stuff in the buffer.
This commit is contained in:
Ali Mohammad Pur 2022-04-15 01:48:56 +04:30 committed by Ali Mohammad Pur
parent 4ea9ca06b4
commit d5b3998d23
5 changed files with 27 additions and 9 deletions

View file

@ -132,12 +132,13 @@ SuggestionManager::CompletionAttemptResult SuggestionManager::attempt_completion
break;
}
result.offset_region_to_remove = { next_suggestion.invariant_offset, shown_length };
result.new_cursor_offset = actual_offset;
auto& suggestion = suggest();
set_current_suggestion_initiation_index(initiation_start_index);
result.offset_region_to_remove = { next_suggestion.invariant_offset, shown_length };
result.new_cursor_offset = actual_offset;
result.static_offset_from_cursor = next_suggestion.static_offset;
if (mode == CompletePrefix) {
// Only auto-complete *if possible*.
if (can_complete) {