summaryrefslogtreecommitdiff
path: root/Userland/DevTools/HackStudio/AutoCompleteResponse.h
diff options
context:
space:
mode:
authorthislooksfun <tlf@thislooks.fun>2021-10-28 20:31:54 -0500
committerAndreas Kling <kling@serenityos.org>2021-11-02 17:53:22 +0100
commitd5baf1c1fa6a16144e3d6af5ac9f9b82c255fd64 (patch)
tree75f2323141c2b1ac3a23fad4096369fe0875d5eb /Userland/DevTools/HackStudio/AutoCompleteResponse.h
parent352f5939588ee788ca6f7a4dfa41fd205fed798b (diff)
downloadserenity-d5baf1c1fa6a16144e3d6af5ac9f9b82c255fd64.zip
LibGUI: Allow autocomplete to stay open after applying
Previously the autocomplete box would always close after applying a suggestion. This is the desired behavior in almost all cases, but there are some situations (like autocompleting paths) where it would be nicer to keep the autocomplete box open after applying the suggestion.
Diffstat (limited to 'Userland/DevTools/HackStudio/AutoCompleteResponse.h')
-rw-r--r--Userland/DevTools/HackStudio/AutoCompleteResponse.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/Userland/DevTools/HackStudio/AutoCompleteResponse.h b/Userland/DevTools/HackStudio/AutoCompleteResponse.h
index f394fa8ff1..b42aa7b386 100644
--- a/Userland/DevTools/HackStudio/AutoCompleteResponse.h
+++ b/Userland/DevTools/HackStudio/AutoCompleteResponse.h
@@ -22,6 +22,7 @@ inline bool encode(IPC::Encoder& encoder, const GUI::AutocompleteProvider::Entry
encoder << (u64)response.partial_input_length;
encoder << (u32)response.language;
encoder << response.display_text;
+ encoder << (u32)response.hide_autocomplete_after_applying;
return true;
}
@@ -30,14 +31,17 @@ inline bool decode(IPC::Decoder& decoder, GUI::AutocompleteProvider::Entry& resp
{
u32 language = 0;
u64 partial_input_length = 0;
+ u32 hide_autocomplete_after_applying = 0;
bool ok = decoder.decode(response.completion)
&& decoder.decode(partial_input_length)
&& decoder.decode(language)
- && decoder.decode(response.display_text);
+ && decoder.decode(response.display_text)
+ && decoder.decode(hide_autocomplete_after_applying);
if (ok) {
response.language = static_cast<GUI::AutocompleteProvider::Language>(language);
response.partial_input_length = partial_input_length;
+ response.hide_autocomplete_after_applying = static_cast<GUI::AutocompleteProvider::Entry::HideAutocompleteAfterApplying>(hide_autocomplete_after_applying);
}
return ok;