From 4b9d86b4700175aaf2d6357a97935b5789a9365a Mon Sep 17 00:00:00 2001 From: Shy Date: Fri, 31 Mar 2017 17:31:54 +0200 Subject: [PATCH] Extended completion --- c4ctrl.vim | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/c4ctrl.vim b/c4ctrl.vim index c14e407..2aeccec 100644 --- a/c4ctrl.vim +++ b/c4ctrl.vim @@ -162,8 +162,11 @@ function s:C4ctrlCompletion(ArgLead, CmdLine, CursorPos) try " Just for cleaning up in the finally statement if stridx("open", get(s:relCmdLine, 1)) == 0 if a:ArgLead != "" - return "open" - elseif len(s:relCmdLine) > 2 " Do not return more than one name + if len(s:relCmdLine) == 2 + return "open" + endif + elseif len(s:relCmdLine) > 2 + " Do not return more than one file name return "" endif let s:cfgdir = s:FindConfigDir() @@ -197,8 +200,11 @@ function s:C4ctrlCompletion(ArgLead, CmdLine, CursorPos) elseif stridx("write", get(s:relCmdLine, 1)) == 0 if a:ArgLead != "" - return "write" - elseif len(s:relCmdLine) > 2 " Do not return more than one name + if len(s:relCmdLine) == 2 && a:ArgLead != "" + return "write" + endif + elseif len(s:relCmdLine) > 2 && a:ArgLead == "" + " Do not return more than one file name return "" endif let s:cfgdir = s:FindConfigDir()