dccsillag / magma-nvim

Interact with Jupyter from NeoVim.
GNU General Public License v3.0
988 stars 50 forks source link

[Feature Request] Can `inputlist` in `_ask_for_choice` be replaced with `vim.ui.select`? #27

Closed IndianBoy42 closed 2 years ago

IndianBoy42 commented 2 years ago

Is your feature request related to a problem? Please describe. vim.ui.select is a lua function that is overridable by the user for so that the user can create alternate uis

Describe the solution you'd like Call the lua function vim.ui.select instead of the viml function inputlist. I guess the main problem is I don't know if lua can be called from python.

A related would be to include a Telescope extension so we can search for the kernel we want to init. This might be more convenient for users, especially if they have a lot of virtual environments with different kernels

dccsillag commented 2 years ago

Oh, I'll definetly do that. Don't worry, it's trivial to call lua functions from Python via Neovim's API.

I wasn't aware of vim.ui.select, that's why we aren't using it now :)

Do you know in which version this was introduced?

IndianBoy42 commented 2 years ago

It seems to be a 0.6 thing, its just a couple of months old: https://github.com/neovim/neovim/pull/15771

vim.ui.input was also merged just 3 weeks ago (https://github.com/neovim/neovim/pull/15959) and I'm hoping plugins move to that from vim.fn.input as well.

dccsillag commented 2 years ago

Ah, thanks!

Later today I'll make it so that, if vim.ui.select is defined, then we use it.

dccsillag commented 2 years ago

Done in 8b30de4916632d1d987f8c918acf0578ad258fa0.

(A bit later then I originally intended, but oh well...)