Commits

ZyX_I committed 083b734

Added plugin/frawor/functions.vim

  • Participants
  • Parent commits 46269ea

Comments (0)

Files changed (1)

File plugin/frawor/functions.vim

+"▶1 Header
+scriptencoding utf-8
+if exists('s:g._pluginloaded') || exists('g:fraworOptions._donotload') ||
+            \exists('g:fraworOptions__donotload')
+    finish
+endif
+execute frawor#Setup('0.0', {}, 1)
+"▶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
+        let fstr=string(d.Function)[10:-3]
+        if fstr[:1]==#'s:'
+            let fstr='<SNR>'.a:plugdict.sid.'_'.fstr[2:]
+        elseif string(+fstr)==#fstr
+            continue
+        endif
+        try
+            execute 'delfunction '.fstr
+        catch /^Vim(delfunction):E130:/
+            " Ignore «Unknown function» error
+        catch /^Vim(delfunction):E131:/
+            " Normally you should catch this error for FraworUnload function, so 
+            " it has bang
+        endtry
+    endfor
+endfunction
+call s:F._frawor.newfeature('delfunctions', {'unloadpre': s:F.delfunctions,
+            \                               'ignoredeps': 1})
+