From fe1f4b456d36f2f38f4bf202e7f17566472e378b Mon Sep 17 00:00:00 2001 From: alemi Date: Wed, 25 Sep 2024 04:10:48 +0200 Subject: [PATCH] feat: mark followed user --- lua/codemp/neo-tree/commands.lua | 1 + lua/codemp/neo-tree/components.lua | 6 +++++- lua/codemp/workspace.lua | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/lua/codemp/neo-tree/commands.lua b/lua/codemp/neo-tree/commands.lua index 0a3a1d0..179ebee 100644 --- a/lua/codemp/neo-tree/commands.lua +++ b/lua/codemp/neo-tree/commands.lua @@ -73,6 +73,7 @@ M.open = function(state, path, extra) vim.api.nvim_win_set_cursor(win, { usr.pos[1] + 1, usr.pos[2] }) end end + manager.refresh("codemp") return end error("unrecognized node type") diff --git a/lua/codemp/neo-tree/components.lua b/lua/codemp/neo-tree/components.lua index 5a754f7..faf7dc8 100644 --- a/lua/codemp/neo-tree/components.lua +++ b/lua/codemp/neo-tree/components.lua @@ -46,7 +46,11 @@ M.icon = function(config, node, state) highlight = highlights.DIRECTORY_ICON end elseif node.type == "user" then - icon = ":" + if node.name == CODEMP.following then + icon = "=" + else + icon = ":" + end highlight = codemp_utils.color(node.name).bg elseif node.type == "entry" then icon = "$" diff --git a/lua/codemp/workspace.lua b/lua/codemp/workspace.lua index 3f357d2..8bdf2c7 100644 --- a/lua/codemp/workspace.lua +++ b/lua/codemp/workspace.lua @@ -47,6 +47,7 @@ local function register_cursor_callback(ws) elseif CODEMP.following ~= nil then print(" / / unfollowing " .. CODEMP.following) CODEMP.following = nil + require('codemp.window').update() end local cur = utils.cursor.position() local buf = vim.api.nvim_get_current_buf()