summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0224
blob: 814fae06bec75a9fdc15502b3e48d19b8c337860 (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
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0224
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.0224
Problem:    Hang in bracketed paste mode when t_PE not encountered.
Solution:   Break out of the loop when got_int is set. (suggested by Christian
            Brabandt, closes #3146)
Files:	    src/edit.c


*** ../vim-8.1.0223/src/edit.c	2018-07-08 16:50:33.103216858 +0200
--- src/edit.c	2018-07-28 23:11:32.282300523 +0200
***************
*** 9685,9706 ****
      int		ret_char = -1;
      int		save_allow_keys = allow_keys;
      int		save_paste = p_paste;
-     int		save_ai = curbuf->b_p_ai;
  
      /* If the end code is too long we can't detect it, read everything. */
      if (STRLEN(end) >= NUMBUFLEN)
  	end = NULL;
      ++no_mapping;
      allow_keys = 0;
!     p_paste = TRUE;
!     curbuf->b_p_ai = FALSE;
  
      for (;;)
      {
! 	/* When the end is not defined read everything. */
  	if (end == NULL && vpeekc() == NUL)
  	    break;
! 	c = plain_vgetc();
  #ifdef FEAT_MBYTE
  	if (has_mbyte)
  	    idx += (*mb_char2bytes)(c, buf + idx);
--- 9685,9715 ----
      int		ret_char = -1;
      int		save_allow_keys = allow_keys;
      int		save_paste = p_paste;
  
      /* If the end code is too long we can't detect it, read everything. */
      if (STRLEN(end) >= NUMBUFLEN)
  	end = NULL;
      ++no_mapping;
      allow_keys = 0;
!     if (!p_paste)
! 	// Also have the side effects of setting 'paste' to make it work much
! 	// faster.
! 	set_option_value((char_u *)"paste", TRUE, NULL, 0);
  
      for (;;)
      {
! 	// When the end is not defined read everything there is.
  	if (end == NULL && vpeekc() == NUL)
  	    break;
! 	do
! 	{
! 	    c = vgetc();
! 	} while (c == K_IGNORE || c == K_VER_SCROLLBAR || c == K_HOR_SCROLLBAR);
! 	if (c == NUL || got_int)
! 	    // When CTRL-C was encountered the typeahead will be flushed and we
! 	    // won't get the end sequence.
! 	    break;
! 
  #ifdef FEAT_MBYTE
  	if (has_mbyte)
  	    idx += (*mb_char2bytes)(c, buf + idx);
***************
*** 9763,9770 ****
  
      --no_mapping;
      allow_keys = save_allow_keys;
!     p_paste = save_paste;
!     curbuf->b_p_ai = save_ai;
  
      return ret_char;
  }
--- 9772,9779 ----
  
      --no_mapping;
      allow_keys = save_allow_keys;
!     if (!save_paste)
! 	set_option_value((char_u *)"paste", FALSE, NULL, 0);
  
      return ret_char;
  }
*** ../vim-8.1.0223/src/version.c	2018-07-28 19:20:09.787586245 +0200
--- src/version.c	2018-07-28 23:08:55.583319931 +0200
***************
*** 800,801 ****
--- 800,803 ----
  {   /* Add new patch number below this line */
+ /**/
+     224,
  /**/

-- 
Computers are not intelligent.  They only think they are.

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