mirror of
https://github.com/powerline/powerline.git
synced 2025-07-26 07:16:31 +02:00
Remove unused purgeonevents_reg and launchevent
This commit is contained in:
parent
9f20fb1f3f
commit
0823f29f7d
@ -49,13 +49,6 @@ else
|
|||||||
\"endfunction"
|
\"endfunction"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
function! PowerlineRegisterCachePurgerEvent(event)
|
|
||||||
exec s:powerline_pycmd 'from powerline.segments.vim import launchevent as powerline_launchevent'
|
|
||||||
augroup Powerline
|
|
||||||
exec 'autocmd' a:event '*' s:powerline_pycmd.' powerline_launchevent("'.a:event.'")'
|
|
||||||
augroup END
|
|
||||||
endfunction
|
|
||||||
|
|
||||||
augroup Powerline
|
augroup Powerline
|
||||||
autocmd! ColorScheme * :exec s:powerline_pycmd 'powerline.reset_highlight()'
|
autocmd! ColorScheme * :exec s:powerline_pycmd 'powerline.reset_highlight()'
|
||||||
autocmd! VimEnter * :redrawstatus!
|
autocmd! VimEnter * :redrawstatus!
|
||||||
|
@ -51,29 +51,6 @@ bufeventfuncs = defaultdict(lambda: [])
|
|||||||
defined_events = set()
|
defined_events = set()
|
||||||
|
|
||||||
|
|
||||||
def purgeonevents_reg(func, events, is_buffer_event=False):
|
|
||||||
if is_buffer_event:
|
|
||||||
cureventfuncs = bufeventfuncs
|
|
||||||
else:
|
|
||||||
cureventfuncs = eventfuncs
|
|
||||||
for event in events:
|
|
||||||
if event not in defined_events:
|
|
||||||
vim.eval('PowerlineRegisterCachePurgerEvent("' + event + '")')
|
|
||||||
defined_events.add(event)
|
|
||||||
cureventfuncs[event].append(func)
|
|
||||||
|
|
||||||
|
|
||||||
def launchevent(event):
|
|
||||||
global eventfuncs
|
|
||||||
global bufeventfuncs
|
|
||||||
for func in eventfuncs[event]:
|
|
||||||
func()
|
|
||||||
if bufeventfuncs[event]:
|
|
||||||
buffer = vim.buffers[int(vim_funcs['expand']('<abuf>')) - 1]
|
|
||||||
for func in bufeventfuncs[event]:
|
|
||||||
func(buffer)
|
|
||||||
|
|
||||||
|
|
||||||
# TODO Remove cache when needed
|
# TODO Remove cache when needed
|
||||||
def window_cached(func):
|
def window_cached(func):
|
||||||
cache = {}
|
cache = {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user