summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-11-04 15:16:56 +0100
committerBram Moolenaar <Bram@vim.org>2017-11-04 15:16:56 +0100
commit52a2f0f1da4e554a81beb45211a9d09afffde595 (patch)
tree622fc8004480640e4f8969ca7b99b5df5cc94235
parent2973daafe1732963b8924cb9df53c608804d66b3 (diff)
downloadvim-git-52a2f0f1da4e554a81beb45211a9d09afffde595.tar.gz
patch 8.0.1258: 'ttymouse' is set to "sgr" even though it's not supportedv8.0.1258
Problem: 'ttymouse' is set to "sgr" even though it's not supported. (Gary Johnson) Solution: Adjust #ifdef
-rw-r--r--src/term.c38
-rw-r--r--src/version.c2
2 files changed, 24 insertions, 16 deletions
diff --git a/src/term.c b/src/term.c
index 8df5e02ec..977987c2b 100644
--- a/src/term.c
+++ b/src/term.c
@@ -4547,22 +4547,6 @@ check_termcode(
{
int need_flush = FALSE;
- /* Only set 'ttymouse' automatically if it was not set
- * by the user already. */
- if (!option_was_set((char_u *)"ttym"))
- {
-# ifdef TTYM_SGR
- if (version >= 277)
- set_option_value((char_u *)"ttym", 0L,
- (char_u *)"sgr", 0);
- else
-# endif
- /* if xterm version >= 95 use mouse dragging */
- if (version >= 95)
- set_option_value((char_u *)"ttym", 0L,
- (char_u *)"xterm2", 0);
- }
-
/* if xterm version >= 141 try to get termcap codes */
if (version >= 141)
{
@@ -4581,6 +4565,28 @@ check_termcode(
* 256, libvterm supports even more. */
if (mch_getenv((char_u *)"COLORS") == NULL)
may_adjust_color_count(256);
+# ifdef FEAT_MOUSE_SGR
+ /* Libvterm can handle SGR mouse reporting. */
+ if (!option_was_set((char_u *)"ttym"))
+ set_option_value((char_u *)"ttym", 0L,
+ (char_u *)"sgr", 0);
+# endif
+ }
+
+ /* Only set 'ttymouse' automatically if it was not set
+ * by the user already. */
+ if (!option_was_set((char_u *)"ttym"))
+ {
+# ifdef FEAT_MOUSE_SGR
+ if (version >= 277)
+ set_option_value((char_u *)"ttym", 0L,
+ (char_u *)"sgr", 0);
+ else
+# endif
+ /* if xterm version >= 95 use mouse dragging */
+ if (version >= 95)
+ set_option_value((char_u *)"ttym", 0L,
+ (char_u *)"xterm2", 0);
}
/* Detect terminals that set $TERM to something like
diff --git a/src/version.c b/src/version.c
index 65f5a4b03..f28132cf9 100644
--- a/src/version.c
+++ b/src/version.c
@@ -762,6 +762,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1258,
+/**/
1257,
/**/
1256,