Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support shortcut for starting manimgl interactively based on current line #2

Closed
Splines opened this issue Oct 15, 2024 · 6 comments
Closed

Comments

@Splines
Copy link
Member

Splines commented Oct 15, 2024

Such a command (with an assignable shortcut) could do the following

Steps

  • Launch a new terminal in a floating window
  • Execute manimgl with params based on the which line the cursor is in, that is
    • Find out in which file the cursor is (probably easy), e.g. path/to/file.py based on the current directory where VSCode is open
    • Find out in which python class the cursor is (probably a lot trickier, maybe pylance provides kind of an API for this?), e.g. SceneName
    • Find out the current line number (probably easy), e.g. 42
    • Pass everything as mangiml path/to/file.py SceneName -se 42

Additional

  • Before doing all of this, check if there isn't already a terminal open. If there is none open, do the steps above.
  • If there is already a terminal open: somehow check if manimgl was already launched in interactive mode (in any of the open terminals).
    • If yes: is there a way to restart it on a new line number? For this case, it is maybe easier to just kill the active session and open a new one. However, this would have the disadvantage that the window position of the OpenGL popup is lost.
    • If no: just start it as described above.
    • Special case: what if multiple terminals run manimgl? Should probably report an error in this case.
@VladimirFokow
Copy link
Collaborator

implemented here

@bhoov
Copy link
Collaborator

bhoov commented Oct 22, 2024

Argh, I would really like to have this functionality as part of the extension before I publish this extension's awesome recent developments (thanks you both!) to the marketplace. However, after doing some research the CC-BY-NC-SA license is not compatible with the MIT license I am currently using. We have two options:

  1. We can implement our own logic from scratch, without inspiration from the original implementation. Or,
  2. We can update the extension's license to CC-BY-NC-SA

I believe this is a very important feature to have as part of the extension. Let me know your thoughts

@VladimirFokow
Copy link
Collaborator

VladimirFokow commented Oct 22, 2024

Hi!
Really awesome contributions from @Splines !

I believe Grant has allowed to use the workflow itself without the CC license.

@bhoov
Copy link
Collaborator

bhoov commented Oct 22, 2024

Oh sick. Let's get this functionality implemented then. Do you want to prep the PR against main?

@VladimirFokow
Copy link
Collaborator

VladimirFokow commented Oct 22, 2024

Yes: #17

@bhoov
Copy link
Collaborator

bhoov commented Oct 25, 2024

This was closed by #17

@bhoov bhoov closed this as completed Oct 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants