[arch-commits] Commit in neovim/trunk (2 files)

Sven-Hendrik Haase svenstaro at archlinux.org
Thu Feb 22 22:20:55 UTC 2018


    Date: Thursday, February 22, 2018 @ 22:20:54
  Author: svenstaro
Revision: 297128

upgpkg: neovim 0.2.2-3

Try to fix mouse wheel not working (FS#57599)

Added:
  neovim/trunk/3a5721e91ba890718319213154ba6964c9dca4d2.patch
Modified:
  neovim/trunk/PKGBUILD

------------------------------------------------+
 3a5721e91ba890718319213154ba6964c9dca4d2.patch |   41 +++++++++++++++++++++++
 PKGBUILD                                       |   14 ++++++-
 2 files changed, 52 insertions(+), 3 deletions(-)

Added: 3a5721e91ba890718319213154ba6964c9dca4d2.patch
===================================================================
--- 3a5721e91ba890718319213154ba6964c9dca4d2.patch	                        (rev 0)
+++ 3a5721e91ba890718319213154ba6964c9dca4d2.patch	2018-02-22 22:20:54 UTC (rev 297128)
@@ -0,0 +1,41 @@
+From 3a5721e91ba890718319213154ba6964c9dca4d2 Mon Sep 17 00:00:00 2001
+From: Chih-Hsuan Yen <yan12125 at gmail.com>
+Date: Mon, 29 Jan 2018 22:47:25 +0800
+Subject: [PATCH] tui: libtermkey: force CSI driver for mouse input #7948
+
+Fixes #7932
+
+Nvim (tui.c) always enables SGR mouse (TUIData.unibi_ext.enable_mouse).
+But if libtermkey sees key_mouse (kmous) in terminfo its terminfo driver
+(driver-ti.c) will be activated, which by accident only supports X10
+protocol. The libtermkey CSI driver (driver-csi.c), in contrast,
+supports SGR.
+
+We can force libtermkey to ignore the terminfo key_mouse entry by
+returning NULL in the tui_tk_ti_getstr hook. That forces the CSI driver.
+
+What is the effect of returning NULL from `tui_tk_ti_getstr()`?
+- libtermkey `driver-ti.c:load_terminfo()` skips the entry.
+- `termkey.c:peekkey()` iterates through all drivers, it finds
+  `TERMKEY_RES_NONE` for the ti driver and falls back to the CSI driver.
+---
+ src/nvim/tui/tui.c | 6 ++++++
+ 1 file changed, 6 insertions(+)
+
+diff --git a/src/nvim/tui/tui.c b/src/nvim/tui/tui.c
+index 2dfe7faa04c..70e19e1d932 100644
+--- a/src/nvim/tui/tui.c
++++ b/src/nvim/tui/tui.c
+@@ -1813,6 +1813,12 @@ static const char *tui_tk_ti_getstr(const char *name, const char *value,
+     if (value != NULL && strequal(stty_erase, value)) {
+       return stty_erase[0] == DEL ? CTRL_H_STR : DEL_STR;
+     }
++  } else if (strequal(name, "key_mouse")) {
++    DLOG("libtermkey:kmous=%s", value);
++    // If key_mouse is found, libtermkey uses its terminfo driver (driver-ti.c)
++    // for mouse input, which by accident only supports X10 protocol.
++    // Force libtermkey to fallback to its CSI driver (driver-csi.c). #7948
++    return NULL;
+   }
+ 
+   return value;

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2018-02-22 22:14:47 UTC (rev 297127)
+++ PKGBUILD	2018-02-22 22:20:54 UTC (rev 297128)
@@ -4,7 +4,7 @@
 
 pkgname=neovim
 pkgver=0.2.2
-pkgrel=2
+pkgrel=3
 pkgdesc='Fork of Vim aiming to improve user experience, plugins, and GUIs'
 arch=('x86_64')
 url='https://neovim.io'
@@ -15,10 +15,18 @@
             'python-neovim: for Python 3 plugin support (see :help python)'
             'xclip: for clipboard support (or xsel) (see :help clipboard)'
             'xsel: for clipboard support (or xclip) (see :help clipboard)')
-source=("https://github.com/neovim/neovim/archive/v${pkgver}.tar.gz")
-sha512sums=('5609defe86ac98356f1b9ae9adc6049bb4df920a9a2ae3104f761d52d4dd54cbc84d2596231595dd9b0aa97201fef2121e6c5c86a19267ab6b871dbf4b568209')
+source=(https://github.com/neovim/neovim/archive/v${pkgver}.tar.gz
+        3a5721e91ba890718319213154ba6964c9dca4d2.patch)
+sha512sums=('5609defe86ac98356f1b9ae9adc6049bb4df920a9a2ae3104f761d52d4dd54cbc84d2596231595dd9b0aa97201fef2121e6c5c86a19267ab6b871dbf4b568209'
+            'f3dabd1bbe195a45a10efacfc4bb78007e32b91c32c01e42f8045c6e39d7a5f7e20eea1c4407c313d7ec0bb6d951a0b4e10b402f50d2022a5b4770ec62594a8a')
 install=neovim.install
 
+prepare() {
+  cd "${srcdir}/neovim-${pkgver}"
+
+  patch -Np1 < "${srcdir}/3a5721e91ba890718319213154ba6964c9dca4d2.patch"
+}
+
 build() {
   mkdir -p "${srcdir}/build"
   cd "${srcdir}/build"



More information about the arch-commits mailing list