mathpad icon indicating copy to clipboard operation
mathpad copied to clipboard

Enable/disable

Open clnhlzmn opened this issue 3 years ago • 2 comments

I love your extension! I have also tried Calculate from Andrew Carreiro which is a similar idea. I prefer how Mathpad shows the results in real time without having to select the expression and run a command, but I would like to be able to use Mathpad on new, non-markdown, files and I would also like to be able to disable it when I am editing a markdown file. Do you have any idea how those changes could be made?

clnhlzmn avatar Sep 10 '20 12:09 clnhlzmn

Good question, I'm not sure that it would be feasible to toggle on a per-file basis, but it might be possible to have a list of file extensions where you can add and remove things from. This complicates extension activation though, since right now the extension doesn't get loaded until you open a Markdown file, for performance.

sagebind avatar Sep 10 '20 15:09 sagebind

What I was thinking was doing something like how Calculate does it. It contributes two commands ("calculate" and "calculate and replace"). You select the expression to calculate and use those commands to run the calculator. I was thinking it would be nice to replace those commands with something like "enable" and "disable". Mathpad would be disabled by default and if I want it to start evaluating expressions I would run the enable command which would enable calculations regardless of file type. I can add the commands easy enough, but looking at the code I can't see how I would actually cause Mathpad to enable or disable.

clnhlzmn avatar Sep 10 '20 16:09 clnhlzmn