Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when trying to change todo status #42

Open
majutsushi opened this issue Nov 17, 2016 · 4 comments
Open

Error when trying to change todo status #42

majutsushi opened this issue Nov 17, 2016 · 4 comments

Comments

@majutsushi
Copy link

In Vim 8.0.49, if I try to use the cit binding to change the TODO status of a line, I get this error after pressing a key to select the status to change to:

Error detected while processing function dotoo#change_todo:
line    4:
E718: Funcref required
line    5:
E718: Funcref required

Unrelated, looking at the source of that function made me notice that it would be good to add the abort modifier to all of the functions so that they stop executing after the first error (see :h :func-abort).

@dhruvasagar
Copy link
Owner

Hey, thanks for the suggestion I will use abort more. This error seems to indicate that dotoo#get_headline() & dotoo#parser#headline#get() perhaps failed to find the headline and returned nothing. So it could mean that either the file which you are trying to manipulate was somehow not parsed or parsed incorrectly. Mind digging a bit deeper ?

@majutsushi
Copy link
Author

majutsushi commented Nov 18, 2016 via email

@dhruvasagar
Copy link
Owner

Hi,

Thanks for looking into this, I believe that is by design, I will try to make sure that when you use this functionality it doesn't give errors when using on non-headline lines.

As far as working with unsaved files go I will have another look, by design since we do a lot of manipulations to files, it is designed to work with unsaved files and tries to read files from buffer, as opposed to reading from the file system so it should in theory work, but there is also a caching layer in play and if files are changed outside of vim there may be gaps and the caches may become invalidated without the plugins knowledge.

paretje added a commit to paretje/dotfiles that referenced this issue Nov 27, 2016
Search for the current heading for `gI`, `gO` and `cit`.
dhruvasagar/vim-dotoo#42
@lgalke
Copy link

lgalke commented Dec 22, 2016

Hey there,
I experienced the same issue from time to time (exactly the same error messages as above). But, at least for me, it is also raised when I type cit inside the headline. From my experience, I assume that the problem is somewhat related to the timestamp in the headline. I paste the malfunctioning file exactly as is here:

* CityX [2017-01-24 Tue 09:00]

** BusinessTrip [2017-01-23 Mon 11:13]
   - Hin- und Rückfahrt: 123,45€

EDIT: I also tried switching CityX with the [datetime] block but that didnt help. However, removing the time and retaining the date did help.

EDIT2: And yes, at some point I also notice that by applying cit, that headlines are rewritten by outdated text or text from other locations in the file, even if I save the file before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants