diff --git a/docs/roadmap.md b/docs/roadmap.md index d562197ad..444cd06ea 100644 --- a/docs/roadmap.md +++ b/docs/roadmap.md @@ -38,9 +38,14 @@ The roadmap defines the project direction and priorities. - [x] add git remote manager - [x] make `` show git log - [x] update remote context when switch project + - [x] use desc for project manager callback function - [ ] cache remote and branch info - [ ] cache info based on project root - [x] implement `ctags#update` in lua + - [x] register project function with description + - [x] update todo list when switch project + - [x] make `one` coloscheme support treesitter + ## Completed diff --git a/lua/spacevim/plugin/todo.lua b/lua/spacevim/plugin/todo.lua index bd2fc92b5..76a9ef4b6 100644 --- a/lua/spacevim/plugin/todo.lua +++ b/lua/spacevim/plugin/todo.lua @@ -11,6 +11,8 @@ local M = {} local sys = require('spacevim.api').import('system') local reg = require('spacevim.api').import('vim.regex') +local project_manager_registered = false + local bufnr = -1 local todo_jobid = -1 local todos = {} @@ -280,8 +282,18 @@ end -- }}} function M.list() -- {{{ + if not project_manager_registered then + require('spacevim.plugin.projectmanager').reg_callback(M.on_cwd_changed, 'update_todo_content') + end open_win() end -- }}} + +function M.on_cwd_changed() + if vim.api.nvim_buf_is_valid(bufnr) then + update_todo_content() + end +end + return M