From 0dba7b331385a37f9aed672aab0243634a0cbe16 Mon Sep 17 00:00:00 2001 From: ridiculousfish Date: Mon, 6 Feb 2012 11:59:34 -0800 Subject: [PATCH] Use right arrow to accept autosuggestions --- reader.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/reader.cpp b/reader.cpp index 0cc1638a0..e7ef2a56f 100644 --- a/reader.cpp +++ b/reader.cpp @@ -3163,7 +3163,17 @@ const wchar_t *reader_readline() { data->buff_pos++; reader_repaint(); - } + } else { + /* We're at the end of our buffer, and the user hit right. Try autosuggestion. */ + if (! data->autosuggestion.empty()) { + /* Accept the autosuggestion */ + data->command_line = data->autosuggestion; + data->buff_pos = data->command_line.size(); + data->check_size(); + reader_super_highlight_me_plenty(data->buff_pos, 0); + reader_repaint(); + } + } break; }