summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0015
blob: 6487102287af077df350f4ed33255d8f5e743af9 (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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0015
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.0015
Problem:    Cursor color wrong when closing a terminal window, ending up in
            another terminal window. (Dominique Pelle)
Solution:   Bail out of terminal_loop() when the buffer changes.
            (closes #2942)
Files:	    src/terminal.c


*** ../vim-8.1.0014/src/terminal.c	2018-05-21 14:55:22.555983588 +0200
--- src/terminal.c	2018-05-21 18:37:16.628386002 +0200
***************
*** 183,196 ****
   * 1. Generic code for all systems.
   */
  
!     static void
! cursor_color_copy(char_u** to_color, char_u* from_color)
! {
!     vim_free(*to_color);
!     *to_color = (from_color == NULL) ? NULL : vim_strsave(from_color);
! }
! 
! 	static int
  cursor_color_equal(char_u *lhs_color, char_u *rhs_color)
  {
      if (lhs_color != NULL && rhs_color != NULL)
--- 183,189 ----
   * 1. Generic code for all systems.
   */
  
!     static int
  cursor_color_equal(char_u *lhs_color, char_u *rhs_color)
  {
      if (lhs_color != NULL && rhs_color != NULL)
***************
*** 198,204 ****
      return lhs_color == NULL && rhs_color == NULL;
  }
  
! 	static char_u *
  cursor_color_get(char_u *color)
  {
      return (color == NULL) ? (char_u *)"" : color;
--- 191,207 ----
      return lhs_color == NULL && rhs_color == NULL;
  }
  
!     static void
! cursor_color_copy(char_u **to_color, char_u *from_color)
! {
!     // Avoid a free & alloc if the value is already right.
!     if (cursor_color_equal(*to_color, from_color))
! 	return;
!     vim_free(*to_color);
!     *to_color = (from_color == NULL) ? NULL : vim_strsave(from_color);
! }
! 
!     static char_u *
  cursor_color_get(char_u *color)
  {
      return (color == NULL) ? (char_u *)"" : color;
***************
*** 2119,2125 ****
  	    while (must_redraw != 0)
  		if (update_screen(0) == FAIL)
  		    break;
! 	if (!term_use_loop_check(TRUE))
  	    /* job finished while redrawing */
  	    break;
  
--- 2122,2128 ----
  	    while (must_redraw != 0)
  		if (update_screen(0) == FAIL)
  		    break;
! 	if (!term_use_loop_check(TRUE) || in_terminal_loop != curbuf->b_term)
  	    /* job finished while redrawing */
  	    break;
  
***************
*** 2127,2133 ****
  	restore_cursor = TRUE;
  
  	c = term_vgetc();
! 	if (!term_use_loop_check(TRUE))
  	{
  	    /* Job finished while waiting for a character.  Push back the
  	     * received character. */
--- 2130,2136 ----
  	restore_cursor = TRUE;
  
  	c = term_vgetc();
! 	if (!term_use_loop_check(TRUE) || in_terminal_loop != curbuf->b_term)
  	{
  	    /* Job finished while waiting for a character.  Push back the
  	     * received character. */
***************
*** 2178,2184 ****
  #ifdef FEAT_CMDL_INFO
  	    clear_showcmd();
  #endif
! 	    if (!term_use_loop_check(TRUE))
  		/* job finished while waiting for a character */
  		break;
  
--- 2181,2188 ----
  #ifdef FEAT_CMDL_INFO
  	    clear_showcmd();
  #endif
! 	    if (!term_use_loop_check(TRUE)
! 					 || in_terminal_loop != curbuf->b_term)
  		/* job finished while waiting for a character */
  		break;
  
*** ../vim-8.1.0014/src/version.c	2018-05-21 16:56:33.687217173 +0200
--- src/version.c	2018-05-21 17:16:16.343071822 +0200
***************
*** 763,764 ****
--- 763,766 ----
  {   /* Add new patch number below this line */
+ /**/
+     15,
  /**/

-- 
OLD WOMAN: Well, how did you become king, then?
ARTHUR: The Lady of the Lake, her arm clad in the purest shimmering samite,
        held Excalibur aloft from the bosom of the water to signify by Divine
        Providence ...  that I, Arthur, was to carry Excalibur ...  That is
        why I am your king!
                 "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD

 /// 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    ///