diff options
author | Siteshwar Vashisht <siteshwar@gmail.com> | 2012-06-29 00:24:37 +0530 |
---|---|---|
committer | Siteshwar Vashisht <siteshwar@gmail.com> | 2012-06-29 00:24:37 +0530 |
commit | 05c721bebbdf6752b66595177194ea174e25f3c5 (patch) | |
tree | 49f9a21b04e4d0e1c6395be0d4aef1b3da6610f1 /reader.cpp | |
parent | e995cc9329faf2d7cbd071c591fe21282e4ef7b8 (diff) |
Some improvements to validate commands suggested from history
Diffstat (limited to 'reader.cpp')
-rw-r--r-- | reader.cpp | 15 |
1 files changed, 2 insertions, 13 deletions
@@ -1255,23 +1255,12 @@ struct autosuggestion_context_t { if (item.str().find('\n') != wcstring::npos) continue; - bool item_ok = false; - if (autosuggest_special_validate_from_history(item.str(), working_directory, &item_ok)) { + if (autosuggest_validate_from_history(item, detector, working_directory, vars)) { /* The command autosuggestion was handled specially, so we're done */ - } else { - /* See if the item has any required paths */ - const path_list_t &paths = item.get_required_paths(); - if (paths.empty()) { - item_ok = true; - } else { - detector.potential_paths = paths; - item_ok = detector.paths_are_valid(paths); - } - } - if (item_ok) { this->autosuggestion = searcher.current_string(); return 1; } + } /* Try handling a special command like cd */ |