Open Otiel opened 6 years ago
I got what you mean. Keep the saved highlights and current highlights in sync... that's probably better in terms of the user experience 👍 Let me think about the configurations.
Yes yes, please : ).
I spent about an hour highlighting my todo list with category colors; then went to look at it today and ... was somewhat perplexed that my work disappeared xD.
Also, apparently "Save Highlights" -> "Workspace" doesn't work when you have just individual files open. I re-highlighted stuff, and today it's gone again.
I've looked a bit into "On Save" hooks in vscode and it looks like something external like watch tasks might actually be an answer.
Maybe do a gulp file change watch that triggers some code inside vscode? As for the save process itself; can the highlights be saved alongside the file or folder/workspace you're working with? Like if you're highlighting a file named todo.txt; then when you enable auto saving; you end up writing another file named todo.txt.highlight.json which specifies all the highlights?
I'm just thinking out loud as it were. This extension is brilliantly written and the idea of coding some of this myself is more and more appealing every day :).
Hi @3dots , thanks for your comments & input! and sorry that you've lost the highlights twice...
Also, apparently "Save Highlights" -> "Workspace" doesn't work
I've just confirmed it. We should at least tell the user that highlights cannot be saved to workspace if workspace is not opened. Thank you for finding/reporting it, I'll raise a ticket.
I'm just thinking out loud
I like this. This way, we can examine possible solutions and refine our ideas 😉
Maybe we should first define ideal behaviours with this auto save feature then think about how we define necessary configs.
Would it be possible to save the highlights automatically, after any change done to the highlights list?
Since there are actually two options for the "Save All Highlights" command (Global or Workspace), I guess that this request could be implemented with an option like
"textmarker.automaticallySaveHighlights" = "global","workspace","off"
.