bhoov / vscode-manim

Simple commands to replicate the manim dev workflow in VSCode
MIT License
1 stars 1 forks source link

Don't copy to clipboard #3

Open Splines opened 1 day ago

Splines commented 1 day ago

This is just a long-term idea. Right now, we rely on the clipboard functionality of the OS since this is what the command checkpoint_paste() is doing: executing in the interactive mode what is copied to the clipboard. This might be annoying if you have just copied some code or something else and then your clipboard gets overwritten.

As a solution, maybe one could find another way to achieve the same behavior, e.g. by letting the extension pasting the selected code directly into the terminal or some other (maybe more elegant?) solution.

However, the naive solution of just pasting the selected code directly into the terminal won't work as checkpoint_paste() is doing more in the background. E.g. it has to find out about the cached scene based on the comment name (as cache key) and probably does some other stuff as well to ensure integrity of the scene. To tackle this issue, maybe a new manim function would have to be introduced.

VladimirFokow commented 1 day ago

or add steps 1 and 3 such that:

  1. save current clipboard to a buffer variable,

  2. (current functionality) copy selected code to clipboard, run checkpoint_paste with it

  3. paste back the buffer variable into the clipboard