diff options
author | zeertzjq <zeertzjq@outlook.com> | 2024-10-20 07:59:43 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-20 07:59:43 +0800 |
commit | 3cf602486ce5cfaa50f33edbe179928f84527dc9 (patch) | |
tree | 68fbcc42cbdb1232a6154e50ef67b9e27232160c /src | |
parent | 4833a63929a83c11379036ead33913711134015b (diff) | |
download | rneovim-3cf602486ce5cfaa50f33edbe179928f84527dc9.tar.gz rneovim-3cf602486ce5cfaa50f33edbe179928f84527dc9.tar.bz2 rneovim-3cf602486ce5cfaa50f33edbe179928f84527dc9.zip |
feat(terminal)!: make 'belloff' and 'visualbell' apply to terminal bell (#30859)
vim-patch:8.2.4744: a terminal window can't use the bell
vim-patch:8.2.4745: using wrong flag for using bell in the terminal
BREAKING CHANGE: Bells from :terminal are now silent by default, unless
'belloff' option doesn't contain "term" or "all".
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/option_vars.h | 3 | ||||
-rw-r--r-- | src/nvim/options.lua | 2 | ||||
-rw-r--r-- | src/nvim/optionstr.c | 3 | ||||
-rw-r--r-- | src/nvim/terminal.c | 3 |
4 files changed, 8 insertions, 3 deletions
diff --git a/src/nvim/option_vars.h b/src/nvim/option_vars.h index 8be437e477..bfdaa11ed9 100644 --- a/src/nvim/option_vars.h +++ b/src/nvim/option_vars.h @@ -403,7 +403,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 EXTERN char *p_bsk; ///< 'backupskip' EXTERN char *p_breakat; ///< 'breakat' diff --git a/src/nvim/options.lua b/src/nvim/options.lua index fba5eab0bc..4e4de1ba31 100644 --- a/src/nvim/options.lua +++ b/src/nvim/options.lua @@ -598,6 +598,7 @@ return { 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. @@ -621,6 +622,7 @@ return { 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/nvim/optionstr.c b/src/nvim/optionstr.c index 082073148e..8e488d2539 100644 --- a/src/nvim/optionstr.c +++ b/src/nvim/optionstr.c @@ -73,7 +73,8 @@ static char *(p_bg_values[]) = { "light", "dark", NULL }; static char *(p_bkc_values[]) = { "yes", "auto", "no", "breaksymlink", "breakhardlink", NULL }; 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 }; + "operator", "register", "shell", "spell", "term", "wildmode", + NULL }; // Note: Keep this in sync with briopt_check() static char *(p_briopt_values[]) = { "shift:", "min:", "sbr", "list:", "column:", NULL }; // Note: Keep this in sync with diffopt_changed() diff --git a/src/nvim/terminal.c b/src/nvim/terminal.c index b916660024..f444021b90 100644 --- a/src/nvim/terminal.c +++ b/src/nvim/terminal.c @@ -1178,9 +1178,10 @@ static int term_settermprop(VTermProp prop, VTermValue *val, void *data) return 1; } +/// Called when the terminal wants to ring the system bell. static int term_bell(void *data) { - ui_call_bell(); + vim_beep(BO_TERM); return 1; } |