Commits

ZyX_I  committed 6bd4f81

@/commands: Made addfunc always load completion functions described by
dictionaries on FuncUndefined event regardless of plugin status

  • Participants
  • Parent commits a5d103e

Comments (0)

Files changed (1)

File autoload/frawor/commands.vim

 let s:commands={}
 let s:bufcommands={}
 let s:fts={}
-"▶2 addfunc      :: cmd, fdescr → + cmd | :function
-function s:F.addfunc(cmd, plstatus, fdescr)
-    if a:plstatus!=2
+"▶2 addfunc      :: cmd, fdescr, now → + cmd | :function
+function s:F.addfunc(cmd, fdescr, now)
+    if a:now
+        call s:F.wrapfunc(a:cmd, a:cmd.compfname, a:fdescr)
+    else
         let fpattern='*'.(s:_sid).'_'.(a:cmd.compfname[2:])
         let augname=s:compaugprefix.(a:cmd.id)
         call s:_f.augroup.add(augname, [['FuncUndefined', fpattern, 0,
                     \                   [s:F.loadplugin, a:cmd]]])
         call add(a:cmd.augs, augname)
         call add(a:cmd.funs, [a:cmd.compfname, a:fdescr])
-    else
-        call s:F.wrapfunc(a:cmd, a:cmd.compfname, a:fdescr)
     endif
 endfunction
 "▶2 loadplugin   :: cmd → + FraworLoad(), :au!
                         call s:_f.throw('nowrapfunc', a:cid, a:plugdict.id)
                     endif
                     let cmd.wrapfunc=a:plugdict.g._f.wrapfunc
-                    call s:F.addfunc(cmd, a:plugdict.status, d.complete)
+                    call s:F.addfunc(cmd, d.complete, 0)
                     let cmdstring.='-complete=customlist,'.(cmd.compfname).' '
                 "▶5 Use FWC string
                 elseif tcomplete==type([])
                     let cmd.g=a:plugdict.g
-                    call s:F.addfunc(cmd, a:plugdict.status, d.complete)
+                    call s:F.addfunc(cmd, d.complete, 1)
                     let cmdstring.='-complete=customlist,'.(cmd.compfname).' '
                 "▶5 Use something else
                 elseif tcomplete==type('')