Manim-Notebook / manim-notebook

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

Don't copy to clipboard #3

Closed Splines closed 1 week ago

Splines commented 2 weeks 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 2 weeks 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