You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What is an issue which you want to solve with your feature request?
We have a Qt-based desktop application for medical image processing and we use python code as a kind of macro language to extend and automate the program.
We'd like to be able to use a full featured editor integrated within the application to work with our python code.
Because our app uses Qt, we have the QWebEngine available and can embed a full featured web browser in our app, and we can call browser's javascript environment from python (e.g. like in this test code). Note that it's all asynchronous on both the javascript and python sides.
Recently the question came up about using a full editor to edit the python code in our app, and I found that I can run you vim.wasm code in our embedded browser:
But I don't see any easy way to get/set the contents of the editor window or be notified in javascript of vim events.
Describe the solution you'd like
I'd like to be able to start the vim.wasm context in the browser and then call a javascript function to populate the current text buffer for editing. Then I'd like to be able to use vim keystrokes to trigger javascript code in the browser that would make calls back to the python code, for example to send selection buffers to python for execution.
Additional context (if any)
I tried using the ?debug argument to set the vim object as window.vim and while I could access vim in the debug console I didn't see any way to set or get the values of the current vim buffers. It would be great if window.vim were available to interact with the browser's javascript enviornment.
Thanks in advance - I'm a long-time vi/vim user and having this available would make me very happy : )
The text was updated successfully, but these errors were encountered:
Update: I was able to host your simple example page and run if from our app. From there I was able to access the vim object from the debug console by setting window.vim = vim in index.js.
But I'm still not seeing any way to get/set the contents of the vim buffer from javascript. Would this require changes to the vim c / wasm code?
Or maybe I can do it by sending synthetic keystrokes?
What is an issue which you want to solve with your feature request?
We have a Qt-based desktop application for medical image processing and we use python code as a kind of macro language to extend and automate the program.
We'd like to be able to use a full featured editor integrated within the application to work with our python code.
Because our app uses Qt, we have the QWebEngine available and can embed a full featured web browser in our app, and we can call browser's javascript environment from python (e.g. like in this test code). Note that it's all asynchronous on both the javascript and python sides.
Recently the question came up about using a full editor to edit the python code in our app, and I found that I can run you vim.wasm code in our embedded browser:
https://discourse.slicer.org/t/directly-interacting-with-python-console/34455/7
But I don't see any easy way to get/set the contents of the editor window or be notified in javascript of vim events.
Describe the solution you'd like
I'd like to be able to start the vim.wasm context in the browser and then call a javascript function to populate the current text buffer for editing. Then I'd like to be able to use vim keystrokes to trigger javascript code in the browser that would make calls back to the python code, for example to send selection buffers to python for execution.
Additional context (if any)
I tried using the
?debug
argument to set thevim
object aswindow.vim
and while I could accessvim
in the debug console I didn't see any way to set or get the values of the current vim buffers. It would be great ifwindow.vim
were available to interact with the browser's javascript enviornment.Thanks in advance - I'm a long-time vi/vim user and having this available would make me very happy : )
The text was updated successfully, but these errors were encountered: