diff src/getchar.c @ 20563:a5a24d688e11 v8.2.0835

patch 8.2.0835: Motif: mapping <C-bslash> still doesn't work Commit: https://github.com/vim/vim/commit/c998370562425e70f4cf202a87112d638f5f7b38 Author: Bram Moolenaar <Bram@vim.org> Date: Thu May 28 21:03:53 2020 +0200 patch 8.2.0835: Motif: mapping <C-bslash> still doesn't work Problem: Motif: mapping <C-bslash> still doesn't work. Solution: Accept CSI for K_SPECIAL. Do not apply CTRL to the character early. (closes #6150)
author Bram Moolenaar <Bram@vim.org>
date Thu, 28 May 2020 21:15:04 +0200
parents 8a694c9447d7
children 5995db0fe84a
line wrap: on
line diff
--- a/src/getchar.c
+++ b/src/getchar.c
@@ -2279,6 +2279,15 @@ handle_mapping(
 		    || ((compl_cont_status & CONT_LOCAL)
 			&& (tb_c1 == Ctrl_N || tb_c1 == Ctrl_P))))
     {
+#ifdef FEAT_GUI
+	if (gui.in_use && tb_c1 == CSI && typebuf.tb_len >= 2
+		&& typebuf.tb_buf[typebuf.tb_off + 1] == KS_MODIFIER)
+	{
+	    // The GUI code sends CSI KS_MODIFIER {flags}, but mappings expect
+	    // K_SPECIAL KS_MODIFIER {flags}.
+	    tb_c1 = K_SPECIAL;
+	}
+#endif
 #ifdef FEAT_LANGMAP
 	if (tb_c1 == K_SPECIAL)
 	    nolmaplen = 2;
@@ -2337,7 +2346,7 @@ handle_mapping(
 		    if (mp->m_keys[mlen] != c2)
 #else
 		    if (mp->m_keys[mlen] !=
-			typebuf.tb_buf[typebuf.tb_off + mlen])
+					 typebuf.tb_buf[typebuf.tb_off + mlen])
 #endif
 			break;
 		}