huantrinh1802 / m_taskwarrior_d.nvim

Simple utility plugin for taskwarrior in Neovim
MIT License
43 stars 8 forks source link

[bug] QueryTask doesn't respect the current query scope and overwrite everything till the end of the buffer #39

Closed huantrinh1802 closed 6 months ago

simonlearnscoding commented 6 months ago

It should be an easy fix by checking if the line starts with # which will indicate that its a new md title and stop there. I can have a look at it if you want or otherwise let me know when I can pull.

also do you think it would be feasible to merge the TWSyncTasks and TWQueryTasks?

I mean TWSyncTasks would run TWSyncTasks for the whole buffer and add every query it finds in an array with the line number, then after it synced, for every query it found it will go to that query and run the TWQueryTasks command there

huantrinh1802 commented 6 months ago

The PR #41 fixed this. I am running manual tests before merging it.

There are a few reasons why I don't want to have TWSyncTasks and TWQueryTasks as one:

Happy to open to new ideas but I cannot see how would I merge these commands.

simonlearnscoding commented 6 months ago

I think one would have to happen after the other, so first twsynctasks would create and sync, then after that twquery would blow up and recreate to make sure its up to date with the query but yeah its probably just personal preference

huantrinh1802 commented 6 months ago

I would say, we can extend the TWQueryTasks to scan the whole buffer. Thus, at the end, you can create a keybind to call TWSyncTasks and TWQueryTasks.

simonlearnscoding commented 6 months ago

yes great idea!