Tuesday, March 14, 2017

Re: Is there any way to update a buffer in the background?

Kay Z wrote:

On 14 March 2017 at 18:18, Kay Z. <l04m33@gmail.com> wrote:
Hmm, seems no one's interested, and the most recent discussion that I can find on this topic goes back to 2015:

    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?

 
It's doable, depending on the conditions.  E.g., no Autocommands are
triggered.  Then setline() and getline() could take a buffer argument.
And it only works if the buffer is loaded.

I have been wondering about these "no autocommands" operations, since it
makes a cleaner interface to just manipulate the text without side
effects.  And we don't need to switch buffers/windows, which also has
lots of side effects.

Would you need more than setline() and getline()?

-- 
hundred-and-one symptoms of being an internet addict:
120. You ask a friend, "What's that big shiny thing?" He says, "It's the sun."

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

--
--
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.

No comments: