I'm writing a plugin, and I'm wondering whether it's possible to update a hidden buffer. The functions and commands I found in the docs, such as seem to work only with the current buffer.
The reason I want to do this is that my plugin used a buffer to show some interactive output, and I want the buffer content to always be up-to-date, whether it's hidden or not.
Currently I made things work by switching the buffers when needed:
function! vlime#ui#WithBuffer(buf, Func)
let old_buf = bufnr('%')
let cur_buf = bufnr(a:buf)
try
execute 'hide buffer ' . cur_buf
return a:Func()
finally
execute 'buffer ' . old_buf
endtry
endfunction
But this messed up the cursor position history, and that's very bad.
So, any suggestions?
Regards,
Kay Z.
https://github.com/neovim/neovim/issues/2750
There may have been little motivation to update buffers in the background, but with the async channel APIs in place, I think we need such functionality now. All the current solutions (that I'm aware of) are basically dirty hacks.
IIRC, the Python API can update any existing buffer, not just the current one. So why can't we have this nice ability in Vimscript? Are there any special reasons?
--
--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
> if the hidden buffer you want to update was started with the --servername argument you can send it commands using the --remote-send option
>
I don't think this is what I'm looking for...