ZyX_I avatar ZyX_I committed 52fe2f3

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

Comments (0)

Files changed (4)

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)

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,

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,

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)')
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.