Patch 8.2.4744

6 views
Skip to first unread message

Bram Moolenaar

unread,
Apr 13, 2022, 6:48:15 AM4/13/22
to vim...@googlegroups.com

Patch 8.2.4744
Problem: A terminal window can't use the bell.
Solution: Add bell support for the terminal window. (closes #10178)
Files: runtime/doc/options.txt, src/gui_w32.c, src/option.h,
src/optionstr.c, src/terminal.c


*** ../vim-8.2.4743/runtime/doc/options.txt 2022-04-09 21:02:58.502251761 +0100
--- runtime/doc/options.txt 2022-04-13 11:39:48.217084350 +0100
***************
*** 1261,1266 ****
--- 1265,1271 ----
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.
***************
*** 1286,1291 ****
--- 1291,1297 ----
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).

*** ../vim-8.2.4743/src/gui_w32.c 2022-04-10 12:37:45.376577706 +0100
--- src/gui_w32.c 2022-04-13 11:39:48.217084350 +0100
***************
*** 1696,1702 ****
void
gui_mch_beep(void)
{
! MessageBeep(MB_OK);
}
/*
* Invert a rectangle from row r, column c, for nr rows and nc columns.
--- 1696,1702 ----
void
gui_mch_beep(void)
{
! MessageBeep((UINT)-1);
}
/*
* Invert a rectangle from row r, column c, for nr rows and nc columns.
*** ../vim-8.2.4743/src/option.h 2022-04-07 12:39:03.987973874 +0100
--- src/option.h 2022-04-13 11:39:48.217084350 +0100
***************
*** 451,457 ****
#define BO_REG 0x8000
#define BO_SH 0x10000
#define BO_SPELL 0x20000
! #define BO_WILD 0x40000

#ifdef FEAT_WILDIGN
EXTERN char_u *p_bsk; // 'backupskip'
--- 451,458 ----
#define BO_REG 0x8000
#define BO_SH 0x10000
#define BO_SPELL 0x20000
! #define BO_TERM 0x40000
! #define BO_WILD 0x80000

#ifdef FEAT_WILDIGN
EXTERN char_u *p_bsk; // 'backupskip'
*** ../vim-8.2.4743/src/optionstr.c 2022-04-07 12:39:03.987973874 +0100
--- src/optionstr.c 2022-04-13 11:39:48.217084350 +0100
***************
*** 20,26 ****
"copy", "ctrlg", "error", "esc", "ex",
"hangul", "insertmode", "lang", "mess",
"showmatch", "operator", "register", "shell",
! "spell", "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
--- 20,26 ----
"copy", "ctrlg", "error", "esc", "ex",
"hangul", "insertmode", "lang", "mess",
"showmatch", "operator", "register", "shell",
! "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
*** ../vim-8.2.4743/src/terminal.c 2022-04-09 18:17:30.060746546 +0100
--- src/terminal.c 2022-04-13 11:39:48.221084337 +0100
***************
*** 3385,3396 ****
limit_scrollback(term, &term->tl_scrollback, TRUE);
}

static VTermScreenCallbacks screen_callbacks = {
handle_damage, // damage
handle_moverect, // moverect
handle_movecursor, // movecursor
handle_settermprop, // settermprop
! NULL, // bell
handle_resize, // resize
handle_pushline, // sb_pushline
NULL // sb_popline
--- 3385,3406 ----
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
! handle_bell, // bell
handle_resize, // resize
handle_pushline, // sb_pushline
NULL // sb_popline
*** ../vim-8.2.4743/src/version.c 2022-04-12 15:40:08.759997291 +0100
--- src/version.c 2022-04-13 11:41:07.160850987 +0100
***************
*** 748,749 ****
--- 748,751 ----
{ /* Add new patch number below this line */
+ /**/
+ 4744,
/**/

--
The word "leader" is derived from the word "lead", as in the material that
bullets are made out of. The term "leader" was popularized at about the same
time as the invention of firearms. It grew out of the observation that the
person in charge of every organization was the person whom everyone wanted to
fill with hot lead.
I don't recomment this; it's just a point of historical interest.
(Scott Adams - The Dilbert principle)

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages