about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMichael Vetter <jubalh@iodoru.org>2022-03-22 12:58:39 +0100
committerMichael Vetter <jubalh@iodoru.org>2022-03-24 15:39:58 +0100
commit923af3ba38361b620066741bc8fa6b08cd3e9325 (patch)
tree4811c96d949fdcb1e22423f8a5ca9a598e9abc61
parent5ea7186c27196340c72a1f83736cca79dd9b692d (diff)
downloadprofani-tty-923af3ba38361b620066741bc8fa6b08cd3e9325.tar.gz
Reset url autocompletion after open/save
I guess we should reset the position after we ran `/url open|save`.
So that next time `/url open <tab>` starts with the latest entry.

Fix https://github.com/profanity-im/profanity/issues/1654
-rw-r--r--src/command/cmd_funcs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/command/cmd_funcs.c b/src/command/cmd_funcs.c
index b1aadbf0..d20167c9 100644
--- a/src/command/cmd_funcs.c
+++ b/src/command/cmd_funcs.c
@@ -9292,6 +9292,8 @@ cmd_url_open(ProfWin* window, const char* const command, gchar** args)
     _url_external_method(cmd_template, url, NULL);
 
 out:
+    // reset autocompletion to start from latest url and not where we left of
+    autocomplete_reset(window->urls_ac);
 
     free(cmd_template);
     free(filename);
@@ -9348,6 +9350,8 @@ cmd_url_save(ProfWin* window, const char* const command, gchar** args)
     }
 
 out:
+    // reset autocompletion to start from latest url and not where we left of
+    autocomplete_reset(window->urls_ac);
 
     free(filename);
     free(cmd_template);