From aac02410b10cebb463c95517e8ff36db5e4aa251 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Thu, 31 Jul 2014 22:43:36 +0100 Subject: [PATCH] Buffer completion match directory names as well for subsequence match --- src/buffer_manager.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/buffer_manager.cc b/src/buffer_manager.cc index 7660d2be..02720a3e 100644 --- a/src/buffer_manager.cc +++ b/src/buffer_manager.cc @@ -105,7 +105,7 @@ CandidateList BufferManager::complete_buffer_name(StringView prefix, for (auto& buffer : m_buffers) { String name = buffer->display_name(); - String match_name = name; + StringView match_name = name; if (not include_dirs and buffer->flags() & Buffer::Flags::File) { ByteCount pos = name.find_last_of('/'); @@ -115,7 +115,7 @@ CandidateList BufferManager::complete_buffer_name(StringView prefix, if (prefix_match(match_name, real_prefix)) result.push_back(escape(name)); - if (subsequence_match(match_name, real_prefix)) + if (subsequence_match(name, real_prefix)) subsequence_result.push_back(escape(name)); } return result.empty() ? subsequence_result : result;