Skip to content

Commit

Permalink
fix: beacon hiding prematurely
Browse files Browse the repository at this point in the history
  • Loading branch information
DanilaMihailov committed Jun 26, 2020
1 parent 99f8c8e commit 751ddac
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion plugin/beacon.vim
Expand Up @@ -27,6 +27,7 @@ let s:fake_buf = nvim_create_buf(v:false, v:true)
let s:float = 0 " floating win id

let s:fade_timer = 0
let s:close_timer = 0

fun! s:IsIgnoreBuffer()
let name = bufname()
Expand All @@ -45,6 +46,10 @@ function! s:Clear_highlight(...) abort
call timer_stop(s:fade_timer)
endif

if s:close_timer > 0
call timer_stop(s:close_timer)
endif

if s:float > 0 && nvim_win_is_valid(s:float)
call nvim_win_close(s:float, 0)
let s:float = 0
Expand Down Expand Up @@ -122,7 +127,7 @@ function! s:Highlight_position(force) abort
let s:fade_timer = timer_start(16, funcref("s:Fade_window"), {'repeat': 35})
endif

call timer_start(g:beacon_timeout, funcref("s:Clear_highlight"), {'repeat': 1})
let s:close_timer = timer_start(g:beacon_timeout, funcref("s:Clear_highlight"), {'repeat': 1})

endfunction

Expand Down

0 comments on commit 751ddac

Please sign in to comment.