diff options
author | LemonBoy <thatlemon@gmail.com> | 2022-04-13 11:47:25 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-04-13 11:47:25 +0100 |
commit | 77771d33f44bfb9f75eb857bd2f2bb4c2860cac3 (patch) | |
tree | 8458b25c002c5dadd13e58398401a5f6c21723b5 | |
parent | 9bbe5c6b8c44e08c90510c36596d13e54ca0eea4 (diff) | |
download | vim-git-77771d33f44bfb9f75eb857bd2f2bb4c2860cac3.tar.gz |
patch 8.2.4744: a terminal window can't use the bellv8.2.4744
Problem: A terminal window can't use the bell.
Solution: Add bell support for the terminal window. (closes #10178)
-rw-r--r-- | runtime/doc/options.txt | 2 | ||||
-rw-r--r-- | src/gui_w32.c | 2 | ||||
-rw-r--r-- | src/option.h | 3 | ||||
-rw-r--r-- | src/optionstr.c | 2 | ||||
-rw-r--r-- | src/terminal.c | 12 | ||||
-rw-r--r-- | src/version.c | 2 |
6 files changed, 19 insertions, 4 deletions
diff --git a/runtime/doc/options.txt b/runtime/doc/options.txt index ddd5af08e..2ed4a8f31 100644 --- a/runtime/doc/options.txt +++ b/runtime/doc/options.txt @@ -1265,6 +1265,7 @@ A jump table for the options with a short description can be found at |Q_op|. separated list of items. For each item that is present, the bell will be silenced. This is most useful to specify specific events in insert mode to be silenced. + You can also make it flash by using 'visualbell'. item meaning when present ~ all All events. @@ -1290,6 +1291,7 @@ A jump table for the options with a short description can be found at |Q_op|. register Unknown register after <C-R> in |Insert-mode|. shell Bell from shell output |:!|. spell Error happened on spell suggest. + term Bell from |:terminal| output. wildmode More matches in |cmdline-completion| available (depends on the 'wildmode' setting). diff --git a/src/gui_w32.c b/src/gui_w32.c index d1cc06d5b..35cb2d26a 100644 --- a/src/gui_w32.c +++ b/src/gui_w32.c @@ -1696,7 +1696,7 @@ gui_mch_haskey(char_u *name) void gui_mch_beep(void) { - MessageBeep(MB_OK); + MessageBeep((UINT)-1); } /* * Invert a rectangle from row r, column c, for nr rows and nc columns. diff --git a/src/option.h b/src/option.h index 4c583a48f..936f260e8 100644 --- a/src/option.h +++ b/src/option.h @@ -451,7 +451,8 @@ EXTERN unsigned bo_flags; #define BO_REG 0x8000 #define BO_SH 0x10000 #define BO_SPELL 0x20000 -#define BO_WILD 0x40000 +#define BO_TERM 0x40000 +#define BO_WILD 0x80000 #ifdef FEAT_WILDIGN EXTERN char_u *p_bsk; // 'backupskip' diff --git a/src/optionstr.c b/src/optionstr.c index fd72da4df..2accd3d27 100644 --- a/src/optionstr.c +++ b/src/optionstr.c @@ -20,7 +20,7 @@ static char *(p_bo_values[]) = {"all", "backspace", "cursor", "complete", "copy", "ctrlg", "error", "esc", "ex", "hangul", "insertmode", "lang", "mess", "showmatch", "operator", "register", "shell", - "spell", "wildmode", NULL}; + "spell", "term", "wildmode", NULL}; static char *(p_nf_values[]) = {"bin", "octal", "hex", "alpha", "unsigned", NULL}; static char *(p_ff_values[]) = {FF_UNIX, FF_DOS, FF_MAC, NULL}; #ifdef FEAT_CRYPT diff --git a/src/terminal.c b/src/terminal.c index b6efb493e..9f9e84ac3 100644 --- a/src/terminal.c +++ b/src/terminal.c @@ -3385,12 +3385,22 @@ handle_postponed_scrollback(term_T *term) limit_scrollback(term, &term->tl_scrollback, TRUE); } +/* + * Called when the terminal wants to ring the system bell. + */ + static int +handle_bell(void *user UNUSED) +{ + vim_beep(BO_SH); + return 0; +} + static VTermScreenCallbacks screen_callbacks = { handle_damage, // damage handle_moverect, // moverect handle_movecursor, // movecursor handle_settermprop, // settermprop - NULL, // bell + handle_bell, // bell handle_resize, // resize handle_pushline, // sb_pushline NULL // sb_popline diff --git a/src/version.c b/src/version.c index 5c8bd2acd..584410a92 100644 --- a/src/version.c +++ b/src/version.c @@ -747,6 +747,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 4744, +/**/ 4743, /**/ 4742, |