Commits

ZyX_I  committed 424dca1

Removed `addedfeatures' plugdict key

  • Participants
  • Parent commits 490ba7c

Comments (0)

Files changed (1)

File plugin/frawor.vim

                 \    'intprefix': 's:g.pls['.
                 \                    substitute(string(plid),'\n', '''."\n".''',
                 \                               'g').']',
-                \'addedfeatures': {},
             \}
     let plugdict.F._frawor={}
     "▶3 Processing dependencies
 endfunction
 "▶1 addfeature
 function s:F.addfeature(plugdict, feature)
-    if has_key(a:plugdict.addedfeatures, a:feature.id)
-        return 0
-    endif
     "▶2 Feature provides constructed function
-    if has_key(a:feature, 'cons')
+    if has_key(a:feature,'cons') && !has_key(a:plugdict.F._frawor, a:feature.id)
         execute  'function a:plugdict.F._frawor.'.a:feature.id."(...)\n".
                     \'    return call(s:g.features.'.a:feature.id.'.cons, '.
                     \                '['.a:plugdict.intprefix."]+a:000, {})\n".
                     \'endfunction'
     endif
     "▶2 Feature registration
-    if has_key(a:feature, 'load')
-        let d={}
-        let d.Result=a:feature.load(a:plugdict)
-        let a:plugdict.features[a:feature.id]=((d.Result is 0)?({}):(d.Result))
-    elseif has_key(a:feature, 'init')
-        let a:plugdict.features[a:feature.id]=deepcopy(a:feature.init)
+    if !has_key(a:plugdict.features, a:feature.id)
+        if has_key(a:feature, 'load')
+            let d={}
+            let d.Result=a:feature.load(a:plugdict)
+            let a:plugdict.features[a:feature.id]=
+                        \((d.Result is 0)?({}):(d.Result))
+        elseif has_key(a:feature, 'init')
+            let a:plugdict.features[a:feature.id]=deepcopy(a:feature.init)
+        endif
     endif
-    let a:plugdict.addedfeatures[a:feature.id]=1
     "▲2
     return a:feature
 endfunction