aboutsummaryrefslogtreecommitdiffhomepage
path: root/reader.cpp
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-03-25 22:41:22 -0700
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2012-03-25 22:41:22 -0700
commita11687fc5c984a18d1d2071c1f88d0a12c5b2f5d (patch)
tree0d5e348ee869f7030bae56a1d0af1e60b9ff49c3 /reader.cpp
parentfa346cec3b307c6013a252475bac532ed0698dbb (diff)
Make the functions builtin have a bit nicer output
Stop autosuggesting things with newlines Make webconfig a little nicer
Diffstat (limited to 'reader.cpp')
-rw-r--r--reader.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/reader.cpp b/reader.cpp
index b645c2b0..00379547 100644
--- a/reader.cpp
+++ b/reader.cpp
@@ -1256,6 +1256,7 @@ struct autosuggestion_context_t {
{
}
+ /* The function run in the background thread to determine an autosuggestion */
int threaded_autosuggest(void) {
ASSERT_IS_BACKGROUND_THREAD();
@@ -1265,6 +1266,11 @@ struct autosuggestion_context_t {
while (searcher.go_backwards()) {
history_item_t item = searcher.current_item();
+
+ /* Skip items with newlines because they make terrible autosuggestions */
+ if (item.str().find('\n') != wcstring::npos)
+ continue;
+
bool item_ok = false;
if (autosuggest_handle_special(item.str(), working_directory, &item_ok)) {
/* The command autosuggestion was handled specially, so we're done */
@@ -3079,7 +3085,6 @@ const wchar_t *reader_readline()
if( ! data->command_line.empty() )
{
if (data->history) {
- //data->history->add(data->command_line);
data->history->add_with_file_detection(data->command_line);
}
}