Fix #14: better active window detection

This commit is contained in:
Olivier Roques
2021-05-21 11:31:23 +02:00
parent 691fec7a16
commit 680cfeb074
3 changed files with 40 additions and 37 deletions

View File

@@ -1,5 +1,4 @@
local cmd, fn = vim.cmd, vim.fn
local g = vim.g
local cmd = vim.cmd
local fmt = string.format
local M = {}
@@ -24,10 +23,6 @@ function M.echo(hlgroup, msg)
cmd('echohl None')
end
function M.is_active()
return g.statusline_winid == fn.win_getid()
end
function M.set_cache_autocmds(augroup)
cmd(fmt('augroup %s', augroup))
cmd('autocmd!')