Mercurial > vim
comparison src/misc2.c @ 12798:5ae0d05e046a v8.0.1276
patch 8.0.1276: key lost when window closed in exit callback
commit https://github.com/vim/vim/commit/a3f7e58bf846b28b347a5d5b96c2d829871bd212
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Nov 9 13:21:58 2017 +0100
patch 8.0.1276: key lost when window closed in exit callback
Problem: Typed key is lost when the terminal window is closed in exit
callback. (Gabriel Barta)
Solution: When the current window changes bail out of the wait loop. (closes
#2302)
author | Christian Brabandt <cb@256bit.org> |
---|---|
date | Thu, 09 Nov 2017 13:30:05 +0100 |
parents | 351cf7c67bbe |
children | ebb4f6c93598 |
comparison
equal
deleted
inserted
replaced
12797:d3c7adaf2e74 | 12798:5ae0d05e046a |
---|---|
6298 * it is safe to do so. | 6298 * it is safe to do so. |
6299 */ | 6299 */ |
6300 void | 6300 void |
6301 parse_queued_messages(void) | 6301 parse_queued_messages(void) |
6302 { | 6302 { |
6303 win_T *old_curwin = curwin; | |
6304 | |
6303 /* For Win32 mch_breakcheck() does not check for input, do it here. */ | 6305 /* For Win32 mch_breakcheck() does not check for input, do it here. */ |
6304 # if defined(WIN32) && defined(FEAT_JOB_CHANNEL) | 6306 # if defined(WIN32) && defined(FEAT_JOB_CHANNEL) |
6305 channel_handle_events(FALSE); | 6307 channel_handle_events(FALSE); |
6306 # endif | 6308 # endif |
6307 | 6309 |
6322 # endif | 6324 # endif |
6323 # ifdef FEAT_JOB_CHANNEL | 6325 # ifdef FEAT_JOB_CHANNEL |
6324 /* Check if any jobs have ended. */ | 6326 /* Check if any jobs have ended. */ |
6325 job_check_ended(); | 6327 job_check_ended(); |
6326 # endif | 6328 # endif |
6329 | |
6330 /* If the current window changed we need to bail out of the waiting loop. | |
6331 * E.g. when a job exit callback closes the terminal window. */ | |
6332 if (curwin != old_curwin) | |
6333 ins_char_typebuf(K_IGNORE); | |
6327 } | 6334 } |
6328 #endif | 6335 #endif |
6329 | 6336 |
6330 #ifndef PROTO /* proto is defined in vim.h */ | 6337 #ifndef PROTO /* proto is defined in vim.h */ |
6331 # ifdef ELAPSED_TIMEVAL | 6338 # ifdef ELAPSED_TIMEVAL |