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

cmd SCNvimReboot (reboot interpreter) #253

Merged
merged 1 commit into from
Jan 23, 2025

Conversation

elgiano
Copy link
Contributor

@elgiano elgiano commented Oct 25, 2024

Add a SCNvimReboot command, equivalent to scide's "Reboot Interpreter", i.e. scnvim.stop() -> scnvim.start().
I added a callback to stop(), so that start() can be called after stop is done waiting for sclang to stop.

No default keymap, but I added an entry in docs as well.

I use reboot sometimes in case of fire (situations like "Library did not compile successfully.", where you can't just recompile).

Let me know if it sounds like a reasonable addition to scnvim!

@elgiano elgiano force-pushed the topic/reboot branch 2 times, most recently from 776f6e8 to d0bfc93 Compare October 28, 2024 09:49
@davidgranstrom
Copy link
Owner

@elgiano Sorry this PR slipped my mind, but it looks good and a very nice addition to the plugin. Cheers!

@davidgranstrom davidgranstrom merged commit 2bd34cb into davidgranstrom:main Jan 23, 2025
4 checks passed
@daveriedstra
Copy link
Contributor

Hi - I think this has introduced a regression. Calling :SCNvimStop now produces an error, I think somehow a non-function is being registered as the callback.

Error executing callback:                                                                                                                                                                                                                                     
vim.schedule: expected function                                                                                                                                                                                                                                         
stack traceback:                                                                                                                                                                                                                                                        
        [C]: in function 'schedule'                                                                                                                                                                                                                                     
        .../dried/.config/nvim/plugged/scnvim/lua/scnvim/sclang.lua:247: in function <.../dried/.config/nvim/plugged/scnvim/lua/scnvim/sclang.lua:233> 

@davidgranstrom
Copy link
Owner

Thanks for the report. I had forgotten that when calling a function (e.g. sclang.stop) from a user command, the command attributes are passed as the first argument. Will push a fix shortly.

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

Successfully merging this pull request may close these issues.

3 participants