Skip to content

Commit 52a2f0f

Browse files
committed
patch 8.0.1258: 'ttymouse' is set to "sgr" even though it's not supported
Problem: 'ttymouse' is set to "sgr" even though it's not supported. (Gary Johnson) Solution: Adjust #ifdef
1 parent 2973daa commit 52a2f0f

2 files changed

Lines changed: 24 additions & 16 deletions

File tree

src/term.c

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4547,22 +4547,6 @@ check_termcode(
45474547
{
45484548
int need_flush = FALSE;
45494549

4550-
/* Only set 'ttymouse' automatically if it was not set
4551-
* by the user already. */
4552-
if (!option_was_set((char_u *)"ttym"))
4553-
{
4554-
# ifdef TTYM_SGR
4555-
if (version >= 277)
4556-
set_option_value((char_u *)"ttym", 0L,
4557-
(char_u *)"sgr", 0);
4558-
else
4559-
# endif
4560-
/* if xterm version >= 95 use mouse dragging */
4561-
if (version >= 95)
4562-
set_option_value((char_u *)"ttym", 0L,
4563-
(char_u *)"xterm2", 0);
4564-
}
4565-
45664550
/* if xterm version >= 141 try to get termcap codes */
45674551
if (version >= 141)
45684552
{
@@ -4581,6 +4565,28 @@ check_termcode(
45814565
* 256, libvterm supports even more. */
45824566
if (mch_getenv((char_u *)"COLORS") == NULL)
45834567
may_adjust_color_count(256);
4568+
# ifdef FEAT_MOUSE_SGR
4569+
/* Libvterm can handle SGR mouse reporting. */
4570+
if (!option_was_set((char_u *)"ttym"))
4571+
set_option_value((char_u *)"ttym", 0L,
4572+
(char_u *)"sgr", 0);
4573+
# endif
4574+
}
4575+
4576+
/* Only set 'ttymouse' automatically if it was not set
4577+
* by the user already. */
4578+
if (!option_was_set((char_u *)"ttym"))
4579+
{
4580+
# ifdef FEAT_MOUSE_SGR
4581+
if (version >= 277)
4582+
set_option_value((char_u *)"ttym", 0L,
4583+
(char_u *)"sgr", 0);
4584+
else
4585+
# endif
4586+
/* if xterm version >= 95 use mouse dragging */
4587+
if (version >= 95)
4588+
set_option_value((char_u *)"ttym", 0L,
4589+
(char_u *)"xterm2", 0);
45844590
}
45854591

45864592
/* Detect terminals that set $TERM to something like

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,8 @@ static char *(features[]) =
761761

762762
static int included_patches[] =
763763
{ /* Add new patch number below this line */
764+
/**/
765+
1258,
764766
/**/
765767
1257,
766768
/**/

0 commit comments

Comments
 (0)