]> granicus.if.org Git - vim/commitdiff
patch 8.2.4744: a terminal window can't use the bell v8.2.4744
authorLemonBoy <thatlemon@gmail.com>
Wed, 13 Apr 2022 10:47:25 +0000 (11:47 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 13 Apr 2022 10:47:25 +0000 (11:47 +0100)
Problem:    A terminal window can't use the bell.
Solution:   Add bell support for the terminal window. (closes #10178)

runtime/doc/options.txt
src/gui_w32.c
src/option.h
src/optionstr.c
src/terminal.c
src/version.c

index ddd5af08edf6d7de8a6467446877c7e3933b539e..2ed4a8f31af8928bf989bb8519efa1c9fbe06c7b 100644 (file)
@@ -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).
 
index d1cc06d5b9372918b21bfc09f65f049d3ec3806e..35cb2d26a2d156880c8cec72f54b725676d437a1 100644 (file)
@@ -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.
index 4c583a48ff1c9e07a5d0186c4569cf65f9ddda4d..936f260e833b0efdb80be186494369f87bdad4a5 100644 (file)
@@ -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'
index fd72da4df62b6344e3a71fbd3ffeaf3b281d4d46..2accd3d27fab820644b682ae3d5280a5ecbbc3bd 100644 (file)
@@ -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
index b6efb493e74ad56fdfc7c550eb4907027dfbcfdb..9f9e84ac3a2cf267d9ea5c67f76453e44c3a2849 100644 (file)
@@ -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
index 5c8bd2acdf445a89061835f5f33b82ee47f57fd5..584410a92a7149139638b983e091245ad5613938 100644 (file)
@@ -746,6 +746,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4744,
 /**/
     4743,
 /**/