Disable buffer completion when there is no prefix/suffix

We still enable it when a custom completion command provides us with completion candidates. For example user might hit escape in a context where a file name should be inserted, without providing any initial prefix or suffix (as the number of expected candidates is small).
This commit is contained in:
Allan Odgaard
2014-04-05 12:55:21 +07:00
parent 6b24c1b11f
commit 7b182c428b

View File

@@ -113,6 +113,9 @@ namespace ng
}
}
if(commandResult.empty() && prefix.empty() && suffix.empty())
return { };
for(ssize_t i = 0; i < commandResult.size(); ++i)
tmp.push_back(std::make_pair(-commandResult.size() + i, commandResult[i]));