summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.1239
blob: c677f975fcb9e135e91d67e5619c75fdd349c937 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
To: vim_dev@googlegroups.com
Subject: Patch 8.1.1239
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 8.1.1239
Problem:    Key with byte sequence containing CSI does not work.
Solution:   Do not recognize CSI as special unless the GUI is active. (Ken
            Takata, closes #4318)
Files:	    src/getchar.c


*** ../vim-8.1.1238/src/getchar.c	2019-04-28 19:46:17.026060122 +0200
--- src/getchar.c	2019-04-29 21:52:57.006045828 +0200
***************
*** 1604,1610 ****
  	    // Get two extra bytes for special keys
  	    if (c == K_SPECIAL
  #ifdef FEAT_GUI
! 		    || c == CSI
  #endif
  	       )
  	    {
--- 1604,1610 ----
  	    // Get two extra bytes for special keys
  	    if (c == K_SPECIAL
  #ifdef FEAT_GUI
! 		    || (gui.in_use && c == CSI)
  #endif
  	       )
  	    {
***************
*** 1659,1677 ****
  		}
  #endif
  #ifdef FEAT_GUI
! 		// Handle focus event here, so that the caller doesn't need to
! 		// know about it.  Return K_IGNORE so that we loop once (needed
! 		// if 'lazyredraw' is set).
! 		if (c == K_FOCUSGAINED || c == K_FOCUSLOST)
  		{
! 		    ui_focus_change(c == K_FOCUSGAINED);
! 		    c = K_IGNORE;
! 		}
  
! 		// Translate K_CSI to CSI.  The special key is only used to
! 		// avoid it being recognized as the start of a special key.
! 		if (c == K_CSI)
! 		    c = CSI;
  #endif
  	    }
  	    // a keypad or special function key was not mapped, use it like
--- 1659,1681 ----
  		}
  #endif
  #ifdef FEAT_GUI
! 		if (gui.in_use)
  		{
! 		    // Handle focus event here, so that the caller doesn't
! 		    // need to know about it.  Return K_IGNORE so that we loop
! 		    // once (needed if 'lazyredraw' is set).
! 		    if (c == K_FOCUSGAINED || c == K_FOCUSLOST)
! 		    {
! 			ui_focus_change(c == K_FOCUSGAINED);
! 			c = K_IGNORE;
! 		    }
  
! 		    // Translate K_CSI to CSI.  The special key is only used
! 		    // to avoid it being recognized as the start of a special
! 		    // key.
! 		    if (c == K_CSI)
! 			c = CSI;
! 		}
  #endif
  	    }
  	    // a keypad or special function key was not mapped, use it like
***************
*** 1749,1755 ****
  		    buf[i] = vgetorpeek(TRUE);
  		    if (buf[i] == K_SPECIAL
  #ifdef FEAT_GUI
! 			    || buf[i] == CSI
  #endif
  			    )
  		    {
--- 1753,1759 ----
  		    buf[i] = vgetorpeek(TRUE);
  		    if (buf[i] == K_SPECIAL
  #ifdef FEAT_GUI
! 			    || (gui.in_use && buf[i] == CSI)
  #endif
  			    )
  		    {
*** ../vim-8.1.1238/src/version.c	2019-04-29 21:46:22.849288641 +0200
--- src/version.c	2019-04-29 21:58:16.735900252 +0200
***************
*** 769,770 ****
--- 769,772 ----
  {   /* Add new patch number below this line */
+ /**/
+     1239,
  /**/

-- 
We learn from our mistakes.  Politicians don't make mistakes.

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///