Closed RAprogramm closed 1 year ago
Easier say than done. At real time I nave not enough knowledge and skills to do that. In my head only - if TODO then count++. I don't want to make same function as we have in this plugin (because it will be duplicate of code I think) . I want to know how to get a count of already we have a list of todos
I you want to add that to the statusline, then you'll need to create a function that properly throttles those calls. You don't wan to do those searches 100s of times per second (redraw of statusline).
As suggested, you can use that search function for that, but the implementation is on you.
local function count()
return require('todo-comments.search').search(
function(results) print(#results) end
)
end
print(count())
this will print number of todos.
but this
local function count()
return require('todo-comments.search').search(
function(results) return #results end
)
end
print(count())
will return nothing! why? i need this number and it will done. what is my problem?
That function is asynchronous, so it doesn't work like that
Anybody have idea how to realize counter in lualine?