On 9/3/2013 4:41 PM, James McCoy wrote:
On Tue, Sep 03, 2013 at 03:09:11PM -0700, Ernie Rael wrote:
It seems that if the SIGINT is always caught/handled and only used
to set a flag such as: interrupt_pending = TRUE, then vim's main
loop could do something like

     if(interrupt_pending == TRUE) {
         interrupt_pending = FALSE;
         /* do vim's process interrupt  stuff */
     }
Something like this would also address the problem where doing something
like ":call taglist('a')" with a large tags file (e.g., all of
/usr/include) takes multiple minutes to return.  This happens because
Vim currently uses select() to monitor for the <C-c> keypress while the
tag processing is happening and those calls to select() dominate the
run time.

If I saw things correctly, select is run under a timer. One possible solution, the timer interrupt could enable SIGINT interrupt if the command is taking a long time and stop using select. Could wait several hundred milliseconds (or even seconds) before doing it. Maybe the bell could be rung to indicate a long running action.

This has some issues, but it might not be too bad. In particular, you don't want to turn on ICANON or anything else that might affect the input character q. Also, while in this mode certain characters (no more than just a couple) will not be put into the typeahead Q. I'm assuming the keyboard chars for abort and suspend will not be put into the Q but at least these particular signals can be ignored. If this is a problem, then I suppose this could be optional behavior (OMG, not another option...)

-ernie


Cheers,

--
--
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Raspunde prin e-mail lui