ZyX_I avatar ZyX_I committed 8d470ae

@%Powerline/Functions/aurum: Added missing s:_functions modifications
@%aurum/move: Fixed #49 (move to a subdirectory fails)
@aurum: Added aurumcmd.unload feature function
Should now be able to reload @%aurum/* plugins correctly

Comments (0)

Files changed (3)

autoload/Powerline/Functions/aurum.vim

     let r=aurum#branch()
     return empty(r) ? '' : a:symbol.' '.r
 endfunction
+let s:_functions+=['Powerline#Functions#aurum#GetBranch']
 function Powerline#Functions#aurum#GetStatus()
     let r=aurum#status()
     return (empty(r) || r is# 'clean') ? '' : toupper(r[0])
 endfunction
+let s:_functions+=['Powerline#Functions#aurum#GetStatus']

autoload/aurum/move.vim

             endfor
             let moves[file]=repo.functions.reltorepo(repo, target)
         endfor
-    elseif a:0==2 && !isdirectory(a:2) && filewritable(a:1)
+    elseif a:0==2 && !isdirectory(a:2) && a:2[-1:] isnot# '/'
         let fst=a:1
         if fst is# ':'
             let fst=s:_r.cmdutils.getrrf(rrfopts, 'nocurf', 'getfile')[3]
         endif
-        let moves = {repo.functions.reltorepo(repo, fst):
-                    \repo.functions.reltorepo(repo, a:2)}
+        if filewritable(fst)
+            let moves = {repo.functions.reltorepo(repo, fst):
+                        \repo.functions.reltorepo(repo, a:2)}
+        else
+            let notfound=1
+        endif
     else
+        let notfound=1
+    endif
+    if exists('notfound')
         let globs=filter(copy(a:000), 'v:val isnot# ":"')
         let hascur=(len(globs)!=a:0)
-        if a:0==1 || !(isdirectory(globs[-1]) && globs[-1][-1:] isnot# '/')
+        if a:0==1 || !(isdirectory(globs[-1]) || globs[-1][-1:] is# '/')
             let target='.'
         else
             let target=remove(globs, -1)
     let a:plugdict.g.cmd={}
     let s:cmddicts[a:plugdict.id]=a:plugdict.g.cmd
 endfunction
+function s:feature.unload(plugdict, fdict)
+    unlet s:cmddicts[a:plugdict.id]
+    if has_key(s:cmdfuncs, a:plugdict.id)
+        unlet s:cmdfuncs[a:plugdict.id]
+    endif
+endfunction
 call s:_f.newfeature('aurumcmd', s:feature)
 "▶1 Global mappings
 " TODO mapping that closes status window
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.