davraamides / todotxt-mode

MIT License
59 stars 12 forks source link

Wrong colors after sort by priority #46

Open daniel-wojcik opened 2 years ago

daniel-wojcik commented 2 years ago

Create two tasks:

task2 (A) task1

place cursor in first line (important) then sort by priority - task1 is moved to first line over task2 but colors are wrong: instead of highlighting (A) two last letters k1 are highlighted. It is fixed after any cursor movement.

davraamides commented 2 years ago

Thanks, @daniel-wojcik. I have noticed this in certain situations. Sometimes VS Code doesn't trigger a redecoration of the document unless the selection changes. I even force that in certain situations by moving the cursor to the end of the line and back to the beginning. But that was always a hack. I'll look into a more robust way to solve that.

Zer0-Vector commented 2 weeks ago

This happened to me too and I can't get seem to get the syntax colors to display again.

I was working on a todotxt language grammar definition to contribute, but it's not quite done yet. If it recognized todotxt as a language instead of overriding the colors of a plaintext file with the extension js, then I think this wouldn't be an issue. It's been a while, so I'll have to pull up what I have so far and remember how the grammars work.😄

@davraamides, did you try using a language grammar definition (.tmGrammar.json) previously? Just curious if you had run into an issue that was conflicting with another feature.

davraamides commented 2 weeks ago

@Zer0-Vector if the problem continues after you reload the todo file, then I'd expect it's something else in your setup.

No, I did not try using a language grammar definition. I think I looked into it but since I wanted extra behaviors, I was going to need an extension anyway and wanted it to be an all-in-one solution.