From 2bb2c467b672d00899b799a5501e55660371c7fd Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sun, 18 May 2014 14:14:37 +0100 Subject: [PATCH] Fix filename/colalias/buffer completion when completing with trailing text --- src/commands.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/commands.cc b/src/commands.cc index ecd792dc..86a2cc4b 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -60,7 +60,7 @@ Buffer* open_fifo(const String& name , const String& filename, bool scroll) const PerArgumentCommandCompleter filename_completer({ [](const Context& context, CompletionFlags flags, const String& prefix, ByteCount cursor_pos) - { return Completions{ 0_byte, prefix.length(), + { return Completions{ 0_byte, cursor_pos, complete_filename(prefix, context.options()["ignored_files"].get(), cursor_pos) }; } @@ -68,7 +68,7 @@ const PerArgumentCommandCompleter filename_completer({ const PerArgumentCommandCompleter buffer_completer({ [](const Context& context, CompletionFlags flags, const String& prefix, ByteCount cursor_pos) - { return Completions{ 0_byte, prefix.length(), + { return Completions{ 0_byte, cursor_pos, BufferManager::instance().complete_buffer_name(prefix, cursor_pos) }; } }); @@ -1205,7 +1205,7 @@ const CommandDesc try_catch_cmd = { static Completions complete_colalias(const Context&, CompletionFlags flags, const String& prefix, ByteCount cursor_pos) { - return {0_byte, prefix.length(), + return {0_byte, cursor_pos, ColorRegistry::instance().complete_alias_name(prefix, cursor_pos)}; }