Commits

ZyX_I  committed c9d6c1e

Fixed errors shown by tests

  • Participants
  • Parent commits 3a6732e

Comments (0)

Files changed (1)

File plugin/frawor/functions.vim

 function s:F.delfunction(sid, Fref)
     let fstr=s:F.rewritefname(a:sid, a:Fref)
     if string(+fstr)==#fstr
-        continue
+        return 3
     endif
     try
         execute 'delfunction '.fstr
 "▶1 delfunctions
 function s:F.delfunctions(plugdict)
     let d={}
-    for d.Function in values(get(a:plugdict.F, '_functions', {}))
-        if type(d.Function)!=2
-            continue
-        endif
-        call s:F.delfunction(a:plugdict.sid, d.Functon)
-    endfor
-    for fdef in values(a:plugdict.features.addextfunctions)
-        call s:F.delfunction(a:plugdict.sid, fdef.function)
-        for key in ["checker", "filter"]
-            if has_key(fdef, key)
-                call s:F._frawor['del'.key](fdef[key])
+    if has_key(a:plugdict.F, '_functions')
+        for [key, d.Function] in items(a:plugdict.F._functions)
+            if type(d.Function)!=2
+                continue
+            endif
+            if s:F.delfunction(a:plugdict.sid, d.Function)
+                unlet a:plugdict.F._functions[key]
             endif
         endfor
-        call remove(a:plugdict.features.addextfunctions, fdef.id)
-    endfor
+    endif
+    if has_key(a:plugdict.features, 'addextfunctions')
+        for fdef in values(a:plugdict.features.addextfunctions)
+            if s:F.delfunction(a:plugdict.sid, fdef.function)
+                for key in ["checker", "filter"]
+                    if has_key(fdef, key)
+                        call call(s:F._frawor['del'.key], [fdef[key]], {})
+                    endif
+                endfor
+                unlet a:plugdict.features.addextfunctions[fdef.id]
+            endif
+        endfor
+    endif
 endfunction
 call s:F._frawor.newfeature('delfunctions', {'unloadpre': s:F.delfunctions,
             \                               'ignoredeps': 1})