vim-themis icon indicating copy to clipboard operation
vim-themis copied to clipboard

Add 'global' helper to register events globally

Open lambdalisue opened this issue 9 years ago • 4 comments

To solve #26. I create a 'global' helper which can register events globally like:

let s:events = {}

function! s:events.initialize() abort
  call themis#log('Initialize')
endfunction

function! s:events.before() abort
  call themis#log('Before')
endfunction

function! s:events.before_each() abort
  call themis#log('Before each')
endfunction

function! s:events.after_each() abort
  call themis#log('After each')
endfunction

function! s:events.after() abort
  call themis#log('After')
endfunction

function! s:events.finalize() abort
  call themis#log('Finalize')
endfunction

" Register global event
call themis#helper('global').with(s:events)

lambdalisue avatar Aug 25 '16 11:08 lambdalisue

すいませんがちょっと保留させてください。インターフェースがちょっとしっくり来ない…(主に with)。

thinca avatar Aug 25 '16 11:08 thinca

Oh. 了解しました。

lambdalisue avatar Aug 25 '16 12:08 lambdalisue

ping

lambdalisue avatar Nov 28 '17 14:11 lambdalisue

これ

call themis#helper('global').use(s:events)

とかだとシックリきたりします?w

lambdalisue avatar Feb 06 '20 12:02 lambdalisue