mirror of
https://github.com/mawww/kakoune.git
synced 2024-12-22 02:51:32 +03:00
support absolute filenames in insert mode filename completion
This commit is contained in:
parent
2125d95076
commit
70cd671ef6
@ -677,12 +677,17 @@ public:
|
|||||||
|
|
||||||
String prefix{begin, pos};
|
String prefix{begin, pos};
|
||||||
StringList res;
|
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() != '/')
|
for (auto dir : options()["path"].get<StringList>())
|
||||||
dir += '/';
|
{
|
||||||
for (auto& filename : Kakoune::complete_filename(dir + prefix, Regex{}))
|
if (not dir.empty() and dir.back() != '/')
|
||||||
res.push_back(filename.substr(dir.length()));
|
dir += '/';
|
||||||
|
for (auto& filename : Kakoune::complete_filename(dir + prefix, Regex{}))
|
||||||
|
res.push_back(filename.substr(dir.length()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (res.empty())
|
if (res.empty())
|
||||||
return {};
|
return {};
|
||||||
|
Loading…
Reference in New Issue
Block a user