Commits

ZyX_I  committed 52fe2f3

Solved some problems with plugin unloading (it tried to modify possibly locked p:_signs, p:_commands and p:_augroups)

  • Participants
  • Parent commits 883f9a2

Comments (0)

Files changed (4)

File plugin/frawor.vim

                     call s:_f.throw('reqfailed', dplid, plid)
                 endif
             endfor
-            "▲2
             "▶2 Running features
             for feature in s:F.getfeatures(plugdict, s:features)
                 call s:F.addfeature(plugdict, feature, 1)

File plugin/frawor/autocommands.vim

         return
     endif
     let d={}
-    while !empty(a:plugdict.g._augroups)
-        let d.agname=remove(a:plugdict.g._augroups, 0)
-        if type(d.agname)==type('') && stridx(d.agname, '#')==-1 &&
-                    \exists('#'.d.agname)
-            call s:F.wipeau(d.agname)
-        endif
-    endwhile
+    call map(filter(copy(a:plugdict.g._augroups),
+                \   'type(v:val)=='.type('').' && stridx(v:val, "#")==-1 && '.
+                \   'exists("#".v:val)'),
+                \'s:F.wipeau(v:val)')
 endfunction
 call s:_f.newfeature('delaugroups', {'unloadpre': s:F.delaugroups,
             \                         'register': s:F.add_augroups,

File plugin/frawor/commands.vim

                 \type(a:plugdict.g._commands)!=type([])
         return
     endif
-    let d={}
-    while !empty(a:plugdict.g._commands)
-        let d.cmdname=remove(a:plugdict.g._commands, 0)
-        if type(d.cmdname)==type('') && d.cmdname=~#'^\u' &&
-                    \exists(':'.d.cmdname)==2
-            execute 'delcommand' d.cmdname
-        endif
-    endwhile
+    for cmd in filter(copy(a:plugdict.g._commands),
+                \     'type(v:val)=='.type('').' && v:val=~#"\\v^\\u\\w+$" && '.
+                \     'exists(":".v:val)')
+        execute 'delcommand' cmd
+    endfor
 endfunction
 call s:_f.newfeature('delcommands', {'unloadpre': s:F.delcommands,
             \                         'register': s:F.add_commands,

File plugin/frawor/signs.vim

     if !has_key(a:plugdict.g, '_signs') || type(a:plugdict.g._signs)!=type([])
         return
     endif
-    call map(filter(a:plugdict.g._signs,
+    call map(filter(copy(a:plugdict.g._signs),
                 \   'type(v:val)=='.type('').' && v:val=~#''\v%(\d+|\h\w*)$'' '.
                 \   '&& s:F.signexists(v:val)'),
                 \'s:F.delsign(v:val)')