dhruvasagar / vim-dotoo

Org-mode like task logging & time tracking in Vim
558 stars 27 forks source link

Refreshing doesn't work #127

Closed talmobi closed 3 years ago

talmobi commented 3 years ago

Reopening agenda view or pressing r for refreshing doesn't work. I have to quick vim entirely for new tasks to be visible. Sometimes saving (pressing s) works but not for getting new tasks.

dhruvasagar commented 3 years ago

You may have to use ., what you describe typically happens when you've had vim running past the current day and dotoo agenda still treats the previous date as current date

talmobi commented 3 years ago

Status update: If I manually open the dotoo buffer (refile.dotoo in this case) I get a warning that it has changed since the last time it was opened. After I open it and open the agenda view again it shows the new tasks. But pressing r or . does not work.

I set an autocmd to authored *.dotoo files, but that still didn't fix the issue -- but now when I open the refile.dotoo buffer the warning no longer shows up (autoread automatically loads it without showing the warning).

I also tried the mapping fix that you did in your last commit for the 'C' key mapping but that didn't seem to do anything.

dhruvasagar commented 3 years ago

@talmobi I am going to take a look at this if it is an issue from dotoo

talmobi commented 3 years ago

@dhruvasagar I'll take a video demonstrating the behaviour later today

dhruvasagar commented 3 years ago

@talmobi that will be helpful, thanks!

talmobi commented 3 years ago

@dhruvasagar https://www.youtube.com/watch?v=eDvQcFVOqIc

dhruvasagar commented 3 years ago

@talmobi Thanks for your efforts, I was able to reproduce this and I have a fix ready. I am just a little vary of how this fix works on older versions of vim.

dhruvasagar commented 3 years ago

@talmobi Do check the commit for your reference. Thanks for reporting this issue and for your help.

talmobi commented 3 years ago

@dhruvasagar I can confirm it's working for me~

talmobi commented 3 years ago

@dhruvasagar btw out of interest, do you have any speculation to why it was working for you and others earlier? But was not working for me?

Or were you using vim-dotoo differently where you would not notice this issue? Am I using it wrong?

Thanks~

I'm using OSX 11.4 (20F71) M1 Laptop. vim 8.2 (2019 Dec 12, compiled Jun 02 2021 13:28:15) macOS version - arm64 Included patches: 1-2925

dhruvasagar commented 3 years ago

@talmobi This bug was introduced fairly recently, basically like described in the commit we moved to using writefile api instead of opening a buffer and edit the file with the help of vimscript (this being slower and requires unnecessary overhead of managing cursor positions etc). I believe I just hadn't noticed this because when you navigate to the refile file manually, it gets updated (the buffer) with changes applied by writefile and dotoo then works as expected, however if you didn't do that it would still see the old data from the buffer. This could also happen if the buffers were updated outside of vim. I just don't create a lot of todos on a daily basis to notice this.

talmobi commented 3 years ago

@dhruvasagar thanks~