Commits

ZyX_I committed aa4eeb6

@%aurum: Made it use removing instead of pausing
python/aurum/repeatedcmd: RepeatedCmd.getvalue is no longer restarting stopped process

Comments (0)

Files changed (3)

autoload/aurum.vim

 "▶1 
 scriptencoding utf-8
-execute frawor#Setup('0.1', {'@%aurum/repo': '5.5',
+execute frawor#Setup('0.1', {'@%aurum/repo': '5.4',
             \                '@aurum/cache': '2.3',
             \            '@%aurum/cmdutils': '4.0',})
 "▶1 getcrf
         let interval=s:_r.cache.getinterval(a:key)
         let rcid=call(a:repo.functions['a'.a:func], [a:repo,interval]+a:000, {})
         let s:akeys[key]={'repo': a:repo, 'rcid': rcid, 'buffers': {a:buf : 1},
-                    \      'key': key}
+                    \      'key': key,    'ckey': a:key}
     else
         let s:akeys[key].buffers[a:buf]=1
     endif
 function s:F.aswitch()
     let bl=tabpagebuflist()
     call map(filter(bl, 'has_key(s:abuffers, v:val)'), '"".v:val')
-    call map(filter(values(s:akeys), 'empty(filter(keys(v:val.buffers), '.
-                \                          '"index(bl, v:val)!=-1"))'),
-                \'v:val.repo.functions.apause(v:val.repo, v:val.rcid)')
+    for adesc in filter(values(s:akeys), 'empty(filter(keys(v:val.buffers), '.
+                \                                     '"index(bl,v:val)!=-1"))')
+        call adesc.repo.functions.aremove(adesc.repo, adesc.rcid)
+        unlet s:akeys[adesc.key]
+        call map(keys(adesc.buffers), 'remove(s:abuffers[v:val], adesc.ckey)')
+    endfor
 endfunction
 augroup AuRCSwitchBuffers
     autocmd BufEnter * :call s:F.aswitch()
     working threading module.
   aget :: rcid[, now] -> ?                                     *aurum-rf-aget*
     Output current value of repeatedly run function. With {now} set to true it 
-    is not using cache. Without {now} or with it set to false it should also 
-    resume what was paused by |aurum-rf-apause|.
+    is not using cache.
   aremove :: rcid                                           *aurum-rf-aremove*
     Stop repeating functions.
   apause :: rcid                                             *aurum-rf-apause*

python/aurum/repeatedcmd.py

 
     def getvalue(self):
         if not self.alive():
-            result = self.getcurrentvalue()
-            self.start()
-            return result
+            return self.getcurrentvalue()
 
         self.qlock.acquire()
         if self.value is None or not self.queue.empty():