summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMaxime Coste <frrrwww@gmail.com>2014-05-18 14:14:37 +0100
committerMaxime Coste <frrrwww@gmail.com>2014-05-18 14:14:37 +0100
commit2bb2c467b672d00899b799a5501e55660371c7fd (patch)
tree47116d64c0e02f92e51e276c227316396f3722cf /src
parent9240cccf74ddf175eb0dac5005633d19e3068539 (diff)
Fix filename/colalias/buffer completion when completing with trailing text
Diffstat (limited to 'src')
-rw-r--r--src/commands.cc6
1 files 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<Regex>(),
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)};
}