Re: javascript version of vim

2013-12-02 Fir de Conversatie Leszek Świrski
On Monday, 2 December 2013 17:01:40 UTC, Mark Manning wrote: > Javascript, by itself, does not have a wait function.  However, you > can create a pseudo wait function by doing the following: > [snip] This code won't work. > the timeout retains its own return information > about where

Re: javascript version of vim

2013-12-02 Fir de Conversatie Mark Manning
Javascript, by itself, does not have a wait function. However, you can create a pseudo wait function by doing the following: while( !input_available() ) mch_delay(50); . . . function mch_delay( time ) { if( time !== undefined ){ settimeout( "mch_delay()", time ); } else return t

javascript version of vim

2013-11-30 Fir de Conversatie 王璐
Hi all, I'm now trying to port vim into javascript with emscripten. The main barrier I found is that the async model of JavaScript. JavaScript is event-driven, and there is no mechanism to sleep and wait for events to be processed, so the following won't work: ``` void wait_for_input()