mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-29 04:09:13 +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:
parent
4ea9ca06b4
commit
d5b3998d23
Notes:
sideshowbarker
2024-07-17 11:42:19 +09:00
Author: https://github.com/alimpfard
Commit: d5b3998d23
Pull-request: https://github.com/SerenityOS/serenity/pull/13686
5 changed files with 27 additions and 9 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue