Mercurial > vim
comparison src/os_win32.c @ 31263:d8e7d725a666 v9.0.0965
patch 9.0.0965: using one window for executing autocommands is insufficient
Commit: https://github.com/vim/vim/commit/e76062c078debed0df818f70e4db14ad7a7cb53a
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Nov 28 18:51:43 2022 +0000
patch 9.0.0965: using one window for executing autocommands is insufficient
Problem: Using one window for executing autocommands is insufficient.
Solution: Use up to five windows for executing autocommands.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 28 Nov 2022 20:00:05 +0100 |
parents | fa26d002eb2a |
children | fa309d9af73c |
comparison
equal
deleted
inserted
replaced
31262:7f766b7e17d5 | 31263:d8e7d725a666 |
---|---|
4876 job = term_getjob(buf->b_term); | 4876 job = term_getjob(buf->b_term); |
4877 ++job->jv_refcount; | 4877 ++job->jv_refcount; |
4878 | 4878 |
4879 // Find a window to make "buf" curbuf. | 4879 // Find a window to make "buf" curbuf. |
4880 aucmd_prepbuf(&aco, buf); | 4880 aucmd_prepbuf(&aco, buf); |
4881 | 4881 if (curbuf == buf) |
4882 clear_oparg(&oa); | 4882 { |
4883 while (term_use_loop()) | 4883 // Only do this when a window was found for "buf". |
4884 { | 4884 clear_oparg(&oa); |
4885 if (oa.op_type == OP_NOP && oa.regname == NUL && !VIsual_active) | 4885 while (term_use_loop()) |
4886 { | 4886 { |
4887 // If terminal_loop() returns OK we got a key that is handled | 4887 if (oa.op_type == OP_NOP && oa.regname == NUL && !VIsual_active) |
4888 // in Normal model. We don't do redrawing anyway. | 4888 { |
4889 if (terminal_loop(TRUE) == OK) | 4889 // If terminal_loop() returns OK we got a key that is handled |
4890 // in Normal model. We don't do redrawing anyway. | |
4891 if (terminal_loop(TRUE) == OK) | |
4892 normal_cmd(&oa, TRUE); | |
4893 } | |
4894 else | |
4890 normal_cmd(&oa, TRUE); | 4895 normal_cmd(&oa, TRUE); |
4891 } | 4896 } |
4892 else | 4897 retval = job->jv_exitval; |
4893 normal_cmd(&oa, TRUE); | 4898 ch_log(NULL, "system command finished"); |
4894 } | 4899 |
4895 retval = job->jv_exitval; | 4900 job_unref(job); |
4896 ch_log(NULL, "system command finished"); | 4901 |
4897 | 4902 // restore curwin/curbuf and a few other things |
4898 job_unref(job); | 4903 aucmd_restbuf(&aco); |
4899 | 4904 } |
4900 // restore curwin/curbuf and a few other things | |
4901 aucmd_restbuf(&aco); | |
4902 | 4905 |
4903 wait_return(TRUE); | 4906 wait_return(TRUE); |
4904 do_buffer(DOBUF_WIPE, DOBUF_FIRST, FORWARD, buf->b_fnum, TRUE); | 4907 do_buffer(DOBUF_WIPE, DOBUF_FIRST, FORWARD, buf->b_fnum, TRUE); |
4905 | 4908 |
4906 vim_free(newcmd); | 4909 vim_free(newcmd); |