Memoize git branch segment in vim
This works kinda like a timer which ensures that the git branch segment isn't called more than once every 2 seconds. Refs #7.
This commit is contained in:
parent
fbce4ac2da
commit
3037b9fbf1
|
@ -4,6 +4,7 @@ import os
|
|||
import vim
|
||||
|
||||
from powerline.ext.vim.bindings import vim_get_func
|
||||
from powerline.lib.memoize import memoize
|
||||
|
||||
vim_funcs = {
|
||||
'col': vim_get_func('col', rettype=int),
|
||||
|
@ -75,6 +76,7 @@ def readonly_indicator(text=u'⭤'):
|
|||
return text if int(vim.eval('&readonly')) else None
|
||||
|
||||
|
||||
@memoize(2)
|
||||
def branch():
|
||||
'''Return VCS branch.
|
||||
|
||||
|
|
Loading…
Reference in New Issue