Commits

ZyX_I  committed 46269ea

Added frawor#Reload function, made plugdict have 0 instead of file for anonymous plugin, documented plugdict values for anonymous plugins

  • Participants
  • Parent commits 6dd9678

Comments (0)

Files changed (3)

File autoload/frawor.vim

                 \                                string(deps).", ".
                 \                                oneload.", s:g, s:F)"
 endfunction
+function frawor#Reload(plid)
+    for file in FraworUnload(a:plid)
+        if file isnot 0
+            execute 'source' fnameescape(file)
+        endif
+    endfor
+endfunction
 

File doc/frawor.txt

         dictionary. Return list of files in order they must be sourced to load 
         unloaded plugins back.
 
+frawor#Reload({plugin})                                      *frawor#Reload()*
+        Wrapper around FraworUnload that will unload {plugin} and immediately 
+        load it back.
+
 ------------------------------------------------------------------------------
 2.2. Commands                                                *frawor-commands*
 
 plugdict :: {}                                             *frawor-t-plugdict*
         Dictionary which describes plugin. It has the following keys:
         Key           Description ~
-        type          Plugin type (first path component after runtimepath or 
-                      empty).
+        type          Plugin type (first path component after runtimepath, 
+                      string "/unknown" if detection of runtimepath failed and 
+                      string "/anonymous" if |FraworRegister()| got zero instead 
+                      of version).
         id            Plugin id.
-        runtimepath   Plugin runtimepath (or empty if detection of rtp failed).
+        runtimepath   Plugin runtimepath, empty if detection of rtp failed or 
+                      |FraworRegister()| got zero instead of version.
         version       Plugin version, see |frawor-t-version|.
         oneload       Bool, true if plugin should be loaded only once.
-        file          Path to plugin file.
-        sid           Plugin script id, see |<SID>|.
+        file          Path to plugin file or 0 if |FraworRegister()| got zero 
+                      instead of version.
+        sid           Plugin script id, see |<SID>|. May be 0 if 
+                      |FraworRegister()| got zero instead of version.
         dependencies  Dictionary which contains pairs {plid} - {version}. When 
                       dependency is loaded it is checked whether actual plugin 
                       version is greater then requested plugin version 

File plugin/frawor.vim

                 \  'runtimepath': plrtp,
                 \      'version': plversion,
                 \      'oneload': !!a:oneload,
-                \         'file': a:file,
+                \         'file': ((a:version is 0)?(0):(a:file)),
                 \          'sid': a:sid,
                 \ 'dependencies': {},
                 \       'status': 1,