mirror of
https://github.com/mawww/kakoune.git
synced 2024-12-26 21:22:00 +03:00
Support ~/ in insert mode filename completion
This commit is contained in:
parent
7ecd65e1af
commit
b53f1271a2
@ -178,6 +178,9 @@ InsertCompletion complete_filename(const Buffer& buffer, ByteCoord cursor_pos,
|
||||
while (begin != buffer.begin() and is_filename(*(begin-1)))
|
||||
--begin;
|
||||
|
||||
if (begin != buffer.begin() and *begin == '/' and *(begin-1) == '~')
|
||||
--begin;
|
||||
|
||||
if (begin == pos)
|
||||
return {};
|
||||
|
||||
@ -186,7 +189,7 @@ InsertCompletion complete_filename(const Buffer& buffer, ByteCoord cursor_pos,
|
||||
return {};
|
||||
|
||||
InsertCompletion::CandidateList candidates;
|
||||
if (prefix.front() == '/')
|
||||
if (prefix.front() == '/' or prefix.front() == '~')
|
||||
{
|
||||
for (auto& filename : Kakoune::complete_filename(prefix, Regex{}))
|
||||
candidates.push_back({ filename, "", filename });
|
||||
|
Loading…
Reference in New Issue
Block a user