Fix programmatic save for custom text editors
What it does
Closes https://github.com/eclipse-theia/theia/issues/9230
Instead of using the EditorManager (that seemingly doesn't keep track of CustomEditorWidget instances), we simply use the monaco model service to save the underlying model.
Also removes an unused RPC method $tryCloseDocument.
How to test
Follow the instructions in https://github.com/eclipse-theia/theia/issues/9230 and confirm that manual saving works as expected. Alternatively, the extension in https://github.com/eclipse-theia/theia/issues/12979 should now also work as expected.
Review checklist
- [x] As an author, I have thoroughly tested my changes and carefully followed the review guidelines
Reminder for reviewers
- As a reviewer, I agree to behave in accordance with the review guidelines
Yes, wholheartedly agree, I am also stuck with CtrlSpace but the binary picker is by now dispensable, since Vim seems to have it built-in. Maybe @girishji 's https://github.com/girishji/scope.vim/ gives an idea. Maybe https://github.com/yehuohan/popc serves you well in the meanwhile, I didn't come around to trying it out, yet
@Konfekt Thanks for pointing me to the right plugins. I'm not very used to configuring Neovim (specifically Lazyvim), so I couldn't delve much into Scope.vim myself. However, as you said, Popc does an amazing job, and now I can use CtrlSpace in a floating window. Thanks so much!
One problem that's newly introduced by using Popc is that now I see the following error when I launch LazyVim:
Error detected while processing function ctrlspace#keys#Keypressed[14]..ctrlspace#keys#workspace#LoadOrSave[2]..<SNR>23_loadWorkspace[32]..ctrlspace#workspaces#LoadWorkspace[62]..<SNR>70_execWorkspaceCommands[26]..TabClosed Autocommands for "*"..function <SNR>31_tabCallback:
line 22:
E516: No buffers were deleted: noautocmd bdelete! 1
E516: No buffers were deleted: noautocmd bdelete! 4
This error occurs only when I turn on Popc. The error disappears if I turn off (mute) Popc. Somehow, the functions in CtrlSpace seem to have been affected by Popc.
I configured both CtrlSpace and Popc using Lazy.nvim, which uses lua script.
There are two more problems to use Popc with CtrlSpace:
- Popc restores tabline, so that tabline appear at the top even though I set
vim.opt.showtabline = 0. - PopcBuffer correctly shows only buffers, not bookmarks, tabs, workspaces. It says
Nothing to popfor everything else than buffers.
Error detected while processing function ctrlspace#keys#Keypressed[14]..ctrlspace#keys#workspace#LoadOrSave[2]..<SNR>23_loadWorkspace[32]..ctrlspace#workspaces#LoadWorkspace[62]..<SNR>70_execWorkspaceCommands[26]..TabClosed Autocommands for "*"..function <SNR>31_tabCallback:
This is best asked at https://github.com/yehuohan/popc/issues but it is likely that as a fork there are competing autocmds
Regarding 2., maybe layers are the answer