diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2013-08-29 13:50:55 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2013-08-29 13:50:55 +0100 |
| commit | 70cd671ef63c28678f73721c82ffb33cd3b662ad (patch) | |
| tree | ad4c366bf78485f3b69ae317840c793fc9137772 /src/input_handler.cc | |
| parent | 2125d9507650def34e301aa0213b91a8a273d495 (diff) | |
support absolute filenames in insert mode filename completion
Diffstat (limited to 'src/input_handler.cc')
| -rw-r--r-- | src/input_handler.cc | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/src/input_handler.cc b/src/input_handler.cc index c0d7b5ed..72b68aa0 100644 --- a/src/input_handler.cc +++ b/src/input_handler.cc @@ -677,12 +677,17 @@ public: String prefix{begin, pos}; StringList res; - for (auto dir : options()["path"].get<StringList>()) + if (prefix.front() == '/') + res = Kakoune::complete_filename(prefix, Regex{}); + else { - if (not dir.empty() and dir.back() != '/') - dir += '/'; - for (auto& filename : Kakoune::complete_filename(dir + prefix, Regex{})) - res.push_back(filename.substr(dir.length())); + for (auto dir : options()["path"].get<StringList>()) + { + if (not dir.empty() and dir.back() != '/') + dir += '/'; + for (auto& filename : Kakoune::complete_filename(dir + prefix, Regex{})) + res.push_back(filename.substr(dir.length())); + } } if (res.empty()) return {}; |
