1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 03:00:04 +08:00

feat(todo): update todo list when switch project

This commit is contained in:
Eric Wong 2024-02-24 18:49:50 +08:00
parent ea76ba75aa
commit b5866a81e7
2 changed files with 17 additions and 0 deletions

View File

@ -38,9 +38,14 @@ The roadmap defines the project direction and priorities.
- [x] add git remote manager - [x] add git remote manager
- [x] make `<cr>` show git log - [x] make `<cr>` show git log
- [x] update remote context when switch project - [x] update remote context when switch project
- [x] use desc for project manager callback function
- [ ] cache remote and branch info - [ ] cache remote and branch info
- [ ] cache info based on project root - [ ] cache info based on project root
- [x] implement `ctags#update` in lua - [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 ## Completed

View File

@ -11,6 +11,8 @@ local M = {}
local sys = require('spacevim.api').import('system') local sys = require('spacevim.api').import('system')
local reg = require('spacevim.api').import('vim.regex') local reg = require('spacevim.api').import('vim.regex')
local project_manager_registered = false
local bufnr = -1 local bufnr = -1
local todo_jobid = -1 local todo_jobid = -1
local todos = {} local todos = {}
@ -280,8 +282,18 @@ end
-- }}} -- }}}
function M.list() -- {{{ 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() open_win()
end end
-- }}} -- }}}
function M.on_cwd_changed()
if vim.api.nvim_buf_is_valid(bufnr) then
update_todo_content()
end
end
return M return M