diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-09-24 13:10:04 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-09-24 13:10:04 +0100 |
commit | f7e7302acb20b6ef6caa0740da1450b677ac91fb (patch) | |
tree | cce4273089bee09073096659b89e75a2d83ab55f /src | |
parent | d3eafdd7098e5e47a3e93474a624cb0ba1a874c9 (diff) | |
download | vim-git-f7e7302acb20b6ef6caa0740da1450b677ac91fb.tar.gz |
patch 9.0.0571: MS-Windows: CTRL-C can make Vim exitv9.0.0571
Problem: MS-Windows: CTRL-C can make Vim exit.
Solution: Check the not-a-term argument.
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 6 | ||||
-rw-r--r-- | src/normal.c | 7 | ||||
-rw-r--r-- | src/proto/main.pro | 1 | ||||
-rw-r--r-- | src/version.c | 2 |
4 files changed, 8 insertions, 8 deletions
diff --git a/src/main.c b/src/main.c index 6875ee5d3..c0059c193 100644 --- a/src/main.c +++ b/src/main.c @@ -1008,7 +1008,7 @@ common_init(mparm_T *paramp) * Return TRUE when the --not-a-term argument was found. */ int -is_not_a_term() +is_not_a_term(void) { return params.not_a_term; } @@ -1016,8 +1016,8 @@ is_not_a_term() /* * Return TRUE when the --not-a-term argument was found or the GUI is in use. */ - static int -is_not_a_term_or_gui() + int +is_not_a_term_or_gui(void) { return params.not_a_term #ifdef FEAT_GUI diff --git a/src/normal.c b/src/normal.c index be578ae27..05397380c 100644 --- a/src/normal.c +++ b/src/normal.c @@ -6793,11 +6793,8 @@ nv_esc(cmdarg_T *cap) && !VIsual_active && no_reason) { - int out_redir = !stdout_isatty -#ifdef FEAT_GUI - && !gui.in_use -#endif - ; + int out_redir = !stdout_isatty && !is_not_a_term_or_gui(); + // The user may accidentally do "vim file | grep word" and then // CTRL-C doesn't show anything. With a changed buffer give the // message on stderr. Without any changes might as well exit. diff --git a/src/proto/main.pro b/src/proto/main.pro index 4368e24fc..f0f9b7360 100644 --- a/src/proto/main.pro +++ b/src/proto/main.pro @@ -2,6 +2,7 @@ int vim_main2(void); void common_init(mparm_T *paramp); int is_not_a_term(void); +int is_not_a_term_or_gui(void); char_u *get_gui_dialog_file(void); int op_pending(void); void may_trigger_safestate(int safe); diff --git a/src/version.c b/src/version.c index 1cbf5514b..ad6a9edfe 100644 --- a/src/version.c +++ b/src/version.c @@ -700,6 +700,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 571, +/**/ 570, /**/ 569, |