Skip to content

Commit

Permalink
Merge pull request #22 from gennaro-tedesco/auto_close
Browse files Browse the repository at this point in the history
autoclosing jqx window on focus change
  • Loading branch information
Gennaro Tedesco authored Sep 21, 2022
2 parents 86a50b9 + 41c3c1f commit 24d3e02
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions plugin/nvim-jqx.vim
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,17 @@ function! FileKeys(A, L, P) abort
return filter(a, 'v:val =~ ''\V\^''.a:A')
endfunction

augroup JqxAutoClose
autocmd!
autocmd WinLeave * call s:JqxClose()
augroup END

function s:JqxClose() abort
for i in range(1, winnr('$'))
if getbufvar(winbufnr(i), '&filetype') ==? 'jqx'
close
endif
endfor
endfunction

let g:loaded_jqx = 1

0 comments on commit 24d3e02

Please sign in to comment.