feat: mark followed user

This commit is contained in:
əlemi 2024-09-25 04:10:48 +02:00
parent a98763217a
commit fe1f4b456d
Signed by: alemi
GPG key ID: A4895B84D311642C
3 changed files with 7 additions and 1 deletions

View file

@ -73,6 +73,7 @@ M.open = function(state, path, extra)
vim.api.nvim_win_set_cursor(win, { usr.pos[1] + 1, usr.pos[2] }) vim.api.nvim_win_set_cursor(win, { usr.pos[1] + 1, usr.pos[2] })
end end
end end
manager.refresh("codemp")
return return
end end
error("unrecognized node type") error("unrecognized node type")

View file

@ -46,7 +46,11 @@ M.icon = function(config, node, state)
highlight = highlights.DIRECTORY_ICON highlight = highlights.DIRECTORY_ICON
end end
elseif node.type == "user" then elseif node.type == "user" then
if node.name == CODEMP.following then
icon = "="
else
icon = ":" icon = ":"
end
highlight = codemp_utils.color(node.name).bg highlight = codemp_utils.color(node.name).bg
elseif node.type == "entry" then elseif node.type == "entry" then
icon = "$" icon = "$"

View file

@ -47,6 +47,7 @@ local function register_cursor_callback(ws)
elseif CODEMP.following ~= nil then elseif CODEMP.following ~= nil then
print(" / / unfollowing " .. CODEMP.following) print(" / / unfollowing " .. CODEMP.following)
CODEMP.following = nil CODEMP.following = nil
require('codemp.window').update()
end end
local cur = utils.cursor.position() local cur = utils.cursor.position()
local buf = vim.api.nvim_get_current_buf() local buf = vim.api.nvim_get_current_buf()