Insert complete: Remove path info with one buffer
This change is useful when using `set scope completers word=buffer`, instead of the default word=all. If candidates all come from the same buffer, then the path/filename information is the same and therefore unnecessary. This change prevents the same path from being repeated, and the buffer's source code is less obscured. More generally, there could be an option to disable the path information entirely in all cases, but for now this change seems a reasonable solution until any such option exists.
This commit is contained in:
parent
46dcd97e19
commit
29a7cd3ab4
|
@ -181,7 +181,7 @@ InsertCompletion complete_word(const SelectionList& sels, const OptionManager& o
|
||||||
if (candidates.empty() or candidates.back().completion != first->candidate())
|
if (candidates.empty() or candidates.back().completion != first->candidate())
|
||||||
{
|
{
|
||||||
DisplayLine menu_entry;
|
DisplayLine menu_entry;
|
||||||
if (first->buffer)
|
if (other_buffers && first->buffer)
|
||||||
{
|
{
|
||||||
const auto pad_len = longest + 1 - first->candidate().char_length();
|
const auto pad_len = longest + 1 - first->candidate().char_length();
|
||||||
menu_entry.push_back(first->candidate().str());
|
menu_entry.push_back(first->candidate().str());
|
||||||
|
|
Loading…
Reference in New Issue
Block a user