From 6021565a28e4925b77d4997a553dfad5fbb521fd Mon Sep 17 00:00:00 2001 From: Gustaf Rydholm Date: Sat, 10 Jun 2023 14:27:06 +0200 Subject: Fix cursorline in neo-tree --- fnl/settings/autocmds.fnl | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'fnl/settings') diff --git a/fnl/settings/autocmds.fnl b/fnl/settings/autocmds.fnl index d32f814..a646130 100644 --- a/fnl/settings/autocmds.fnl +++ b/fnl/settings/autocmds.fnl @@ -1,4 +1,7 @@ ;; Autocommands for nvim. + +(local cursorline (require :util.cursorline)) + (local autocmds [[:FileType {:pattern [:qf :help :man :lspinfo :spectre_panel] @@ -38,21 +41,8 @@ (vim.keymap.set :t : "wincmd j" {}) (vim.keymap.set :t : "wincmd k" {}) (vim.keymap.set :t : "wincmd l" {}))}] - [[:InsertLeave :WinEnter] - {:callback (fn [] - (let [(ok cl) (pcall vim.api.nvim_win_get_var 0 - :auto-cursorline)] - (if (and ok cl) - (do - (set vim.wo.cursorline true) - (vim.api.nvim_win_del_var 0 :auto-cursorline)))))}] - [[:InsertEnter :WinLeave] - {:callback (fn [] - (let [cl vim.wo.cursorline] - (if cl - (do - (vim.api.nvim_win_set_var 0 :auto-cursorline cl) - (set vim.wo.cursorline false)))))}]]) + [[:InsertLeave :WinEnter] {:callback cursorline.show}] + [[:InsertEnter :WinLeave] {:callback cursorline.hide}]]) (each [_ autocmd (ipairs autocmds)] (match autocmd -- cgit v1.2.3-70-g09d2