Loading ...
Sorry, an error occurred while loading the content.

Re: [PATCH] Asynchronous functions (settimeout, setinterval, and cancelinterval)

Expand Messages
  • Ben Fritz
    ... Exactly. I think as long as you can interrupt the timer with a keystroke it should be fine. But since you call your timer in between waiting for a
    Message 1 of 105 , Sep 5, 2013
    • 0 Attachment
      On Thursday, September 5, 2013 8:44:15 AM UTC-5, Bjorn Tipling wrote:
      > > As someone already mentioned: If the command takes too much time, Vim
      > > will get stuck. E.g. when it reads from a socket. It might be possible
      > > to have this kind of work done in another thread, e.g. using Python.
      >
      >
      > Hey check this out:
      >
      > au CursorHold * call BlockForever()
      >
      >
      > " Blocks forever
      > function! BlockForever()
      > let c = 1
      > while c >= 0
      > let c += 1
      > endwhile
      > endfunction
      >
      > You can already do this blocking, I've already experienced it with plugins I've removed. I ask again why setTimeout should be treated differently than CursorHold? You can cntrl-c out of CursorHold, but just then make that a requirement for settimeout.
      >

      Exactly. I think as long as you can interrupt the timer with a keystroke it should be fine. But since you call your timer in between waiting for a keystroke, won't that prevent CTRL-C from interrupting it? Maybe it won't...I haven't tried it. I don't think we have any unique constraints, I just think that (a) it should be mentioned in the help that the timer blocks user input while processing, it's not a true asynchronous process and (b) it is required that CTRL-C or similar can interrupt the timer like it can already for autocmds, etc.

      --
      --
      You received this message from the "vim_dev" 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_dev" group.
      To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
      For more options, visit https://groups.google.com/groups/opt_out.
    • Bjorn Tipling
      By the way if anyone wants to check out or help us maintain the fork with timers until Bram is ready to check out the patch, it s here:
      Message 105 of 105 , Nov 25, 2013
      • 0 Attachment
        By the way if anyone wants to check out or help us maintain the fork with timers until Bram is ready to check out the patch, it's here:

        https://github.com/Floobits/vim

        It's a month behind at the moment, but we will keep it up to date.

        --
        --
        You received this message from the "vim_dev" 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_dev" group.
        To unsubscribe from this group and stop receiving emails from it, send an email to vim_dev+unsubscribe@....
        For more options, visit https://groups.google.com/groups/opt_out.
      Your message has been successfully submitted and would be delivered to recipients shortly.