about summary refs log tree commit diff stats
path: root/src/ui/privwin.c
diff options
context:
space:
mode:
authorMarcoPolo-PasTonMolo <marcopolopastonmolo@protonmail.com>2022-03-21 00:10:07 +0200
committerMarcoPolo-PasTonMolo <marcopolopastonmolo@protonmail.com>2022-03-21 13:46:50 +0200
commit06ef6842e8ff6b7a754c54f4af39775bc842612b (patch)
treeb811ac7e13551c8ca9fbfc072a2e7a5fc37acf34 /src/ui/privwin.c
parent09e7f63c790089acfe1fd39f686597891cada5a7 (diff)
downloadprofani-tty-06ef6842e8ff6b7a754c54f4af39775bc842612b.tar.gz
Add quote autocompletion for previous messages
Fixes https://github.com/profanity-im/profanity/issues/1649

Type `>` then press tab or shift tab to autocomplete previous messages,
then type your reply and send message.
Newlines are replaced with newline followed by `> `.
A newline is added at the end so that the user can immediately type a
message without manually adding a new line.
Diffstat (limited to 'src/ui/privwin.c')
-rw-r--r--src/ui/privwin.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/ui/privwin.c b/src/ui/privwin.c
index 73ef61a0..20611ea4 100644
--- a/src/ui/privwin.c
+++ b/src/ui/privwin.c
@@ -82,6 +82,7 @@ privwin_incoming_msg(ProfPrivateWin* privatewin, ProfMessage* message)
     }
 
     wins_add_urls_ac(window, message);
+    wins_add_quotes_ac(window, message->plain);
 
     if (prefs_get_boolean(PREF_BEEP)) {
         beep();
@@ -99,6 +100,8 @@ privwin_outgoing_msg(ProfPrivateWin* privwin, const char* const message)
 {
     assert(privwin != NULL);
 
+    ProfWin* window = (ProfWin*)privwin;
+    wins_add_quotes_ac(window, message);
     win_print_outgoing((ProfWin*)privwin, "-", NULL, NULL, message);
 }