summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.1105
blob: cae02b6c89307b09cdc8b2e4256a386f3255eaf9 (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
To: vim_dev@googlegroups.com
Subject: Patch 8.1.1105
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.1105
Problem:    Long escape sequences may be split up.
Solution:   Assume esccape sequences can be up to 80 bytes long. (Nobuhiro
            Takasaki, closes #4196)
Files:	    src/term.c


*** ../vim-8.1.1104/src/term.c	2019-03-30 22:11:17.534968563 +0100
--- src/term.c	2019-04-03 20:43:35.324955447 +0200
***************
*** 2538,2549 ****
  }
  
  /*
!  * the number of calls to ui_write is reduced by using the buffer "out_buf"
   */
  #define OUT_SIZE	2047
! 	    /* Add one to allow mch_write() in os_win32.c to append a NUL */
  static char_u		out_buf[OUT_SIZE + 1];
! static int		out_pos = 0;	/* number of chars in out_buf */
  
  /*
   * out_flush(): flush the output buffer
--- 2538,2555 ----
  }
  
  /*
!  * The number of calls to ui_write is reduced by using "out_buf".
   */
  #define OUT_SIZE	2047
! 
! // add one to allow mch_write() in os_win32.c to append a NUL
  static char_u		out_buf[OUT_SIZE + 1];
! 
! static int		out_pos = 0;	// number of chars in out_buf
! 
! // Since the maximum number of SGR parameters shown as a normal value range is
! // 16, the escape sequence length can be 4 * 16 + lead + tail.
! #define MAX_ESC_SEQ_LEN	80
  
  /*
   * out_flush(): flush the output buffer
***************
*** 2660,2671 ****
      void
  out_str_nf(char_u *s)
  {
!     if (out_pos > OUT_SIZE - 20)  /* avoid terminal strings being split up */
  	out_flush();
      while (*s)
  	out_char_nf(*s++);
  
!     /* For testing we write one string at a time. */
      if (p_wd)
  	out_flush();
  }
--- 2666,2679 ----
      void
  out_str_nf(char_u *s)
  {
!     // avoid terminal strings being split up
!     if (out_pos > OUT_SIZE - MAX_ESC_SEQ_LEN)
  	out_flush();
+ 
      while (*s)
  	out_char_nf(*s++);
  
!     // For testing we write one string at a time.
      if (p_wd)
  	out_flush();
  }
***************
*** 2694,2700 ****
  	    return;
  	}
  #endif
! 	if (out_pos > OUT_SIZE - 20)
  	    out_flush();
  #ifdef HAVE_TGETENT
  	for (p = s; *s; ++s)
--- 2702,2708 ----
  	    return;
  	}
  #endif
! 	if (out_pos > OUT_SIZE - MAX_ESC_SEQ_LEN)
  	    out_flush();
  #ifdef HAVE_TGETENT
  	for (p = s; *s; ++s)
***************
*** 2762,2768 ****
  	}
  #endif
  	/* avoid terminal strings being split up */
! 	if (out_pos > OUT_SIZE - 20)
  	    out_flush();
  #ifdef HAVE_TGETENT
  	tputs((char *)s, 1, TPUTSFUNCAST out_char_nf);
--- 2770,2776 ----
  	}
  #endif
  	/* avoid terminal strings being split up */
! 	if (out_pos > OUT_SIZE - MAX_ESC_SEQ_LEN)
  	    out_flush();
  #ifdef HAVE_TGETENT
  	tputs((char *)s, 1, TPUTSFUNCAST out_char_nf);
*** ../vim-8.1.1104/src/version.c	2019-04-03 20:30:56.085017544 +0200
--- src/version.c	2019-04-03 20:38:21.846531027 +0200
***************
*** 773,774 ****
--- 773,776 ----
  {   /* Add new patch number below this line */
+ /**/
+     1105,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
187. You promise yourself that you'll only stay online for another
     15 minutes...at least once every hour.

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