aboutsummaryrefslogtreecommitdiffhomepage
path: root/reader.cpp
diff options
context:
space:
mode:
authorGravatar Siteshwar Vashisht <siteshwar@gmail.com>2012-06-29 00:24:37 +0530
committerGravatar Siteshwar Vashisht <siteshwar@gmail.com>2012-06-29 00:24:37 +0530
commit05c721bebbdf6752b66595177194ea174e25f3c5 (patch)
tree49f9a21b04e4d0e1c6395be0d4aef1b3da6610f1 /reader.cpp
parente995cc9329faf2d7cbd071c591fe21282e4ef7b8 (diff)
Some improvements to validate commands suggested from history
Diffstat (limited to 'reader.cpp')
-rw-r--r--reader.cpp15
1 files changed, 2 insertions, 13 deletions
diff --git a/reader.cpp b/reader.cpp
index d7f5235d..9b2960cc 100644
--- a/reader.cpp
+++ b/reader.cpp
@@ -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 */