From 1cbac1fb2001437f22c1eefce1341dc66f5bf768 Mon Sep 17 00:00:00 2001 From: Turiiya <34311583+ttytm@users.noreply.github.com> Date: Mon, 19 Aug 2024 13:58:19 +0200 Subject: [PATCH] tree(hl): hide gui cursor, only use cursorline for indicating node position in tree --- lua/nxvim/plugins/neo-tree.lua | 1 + lua/nxvim/plugins/noice.lua | 16 +++++++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/lua/nxvim/plugins/neo-tree.lua b/lua/nxvim/plugins/neo-tree.lua index 65f58c6..69abb37 100644 --- a/lua/nxvim/plugins/neo-tree.lua +++ b/lua/nxvim/plugins/neo-tree.lua @@ -330,6 +330,7 @@ nx.au({ pattern = "neo-tree-popup", callback = function() vim.schedule(function() + vim.cmd("set gcr=n-v-c-sm:block,i-ci-ve:ver25,r-cr-o:hor20") nx.map({ -- Allow to escape into normal mode in fuzzy finder input popup. { "", "", "i" }, diff --git a/lua/nxvim/plugins/noice.lua b/lua/nxvim/plugins/noice.lua index 0b0981f..862d50d 100644 --- a/lua/nxvim/plugins/noice.lua +++ b/lua/nxvim/plugins/noice.lua @@ -50,7 +50,21 @@ require("noice").setup({ -- == [ Events ================================================================ -nx.hl({ { "NoiceCmdlinePopupBorder", "NoiceCmdlineIconCmdLine" }, link = "Operator" }) +local hacks = require("noice.util.hacks") + +nx.au({ + { "WinEnter", "FocusGained" }, + callback = function(ev) + -- if vim.bo[ev.buf].filetype ~= "neo-tree" then vim.cmd("set gcr=n-v-c-sm:block,i-ci-ve:ver25,r-cr-o:hor20") end + if not ev.buf then return end + if vim.bo[ev.buf].filetype == "neo-tree" then + hacks.hide_cursor() + else + -- hacks.show_cursor() + vim.cmd("set gcr=n-v-c-sm:block,i-ci-ve:ver25,r-cr-o:hor20") + end + end, +}) -- ] -- == [ Keymaps ===============================================================