summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.1289
blob: ed8de52291ff09a6656df3d5cb8dbce94fac2a3e (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
To: vim_dev@googlegroups.com
Subject: Patch 8.1.1289
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.1289
Problem:    May not have enough space to add "W" to search stats.
Solution:   Reserve a bit more space. (Christian Brabandt)
Files:	    src/search.c


*** ../vim-8.1.1288/src/search.c	2019-05-07 21:29:08.427331900 +0200
--- src/search.c	2019-05-07 21:32:31.546229160 +0200
***************
*** 1219,1224 ****
--- 1219,1225 ----
      char_u	    *ps;
      char_u	    *msgbuf = NULL;
      size_t	    len;
+ #define SEARCH_STAT_BUF_LEN 12
  
      /*
       * A line offset is not remembered, this is vi compatible.
***************
*** 1399,1406 ****
  		else
  		    // Use up to 'showcmd' column.
  		    len = (int)(Rows - msg_row - 1) * Columns + sc_col - 1;
! 		if (len < STRLEN(p) + 40 + 11)
! 		    len = STRLEN(p) + 40 + 11;
  	    }
  	    else
  		// Reserve enough space for the search pattern + offset.
--- 1400,1407 ----
  		else
  		    // Use up to 'showcmd' column.
  		    len = (int)(Rows - msg_row - 1) * Columns + sc_col - 1;
! 		if (len < STRLEN(p) + 40 + SEARCH_STAT_BUF_LEN + 1)
! 		    len = STRLEN(p) + 40 + SEARCH_STAT_BUF_LEN + 1;
  	    }
  	    else
  		// Reserve enough space for the search pattern + offset.
***************
*** 4982,5018 ****
      }
      if (cur > 0)
      {
! #define STAT_BUF_LEN 12
! 	char	t[STAT_BUF_LEN] = "";
  	int	len;
  
  #ifdef FEAT_RIGHTLEFT
  	if (curwin->w_p_rl && *curwin->w_p_rlc == 's')
  	{
  	    if (cur == OUT_OF_TIME)
! 		vim_snprintf(t, STAT_BUF_LEN, "[?/??]");
  	    else if (cnt > 99 && cur > 99)
! 		vim_snprintf(t, STAT_BUF_LEN, "[>99/>99]");
  	    else if (cnt > 99)
! 		vim_snprintf(t, STAT_BUF_LEN, "[>99/%d]", cur);
  	    else
! 		vim_snprintf(t, STAT_BUF_LEN, "[%d/%d]", cnt, cur);
  	}
  	else
  #endif
  	{
  	    if (cur == OUT_OF_TIME)
! 		vim_snprintf(t, STAT_BUF_LEN, "[?/??]");
  	    else if (cnt > 99 && cur > 99)
! 		vim_snprintf(t, STAT_BUF_LEN, "[>99/>99]");
  	    else if (cnt > 99)
! 		vim_snprintf(t, STAT_BUF_LEN, "[%d/>99]", cur);
  	    else
! 		vim_snprintf(t, STAT_BUF_LEN, "[%d/%d]", cur, cnt);
  	}
  
  	len = STRLEN(t);
! 	if (show_top_bot_msg && len + 3 < STAT_BUF_LEN)
  	{
  	    STRCPY(t + len, " W");
  	    len += 2;
--- 4983,5018 ----
      }
      if (cur > 0)
      {
! 	char	t[SEARCH_STAT_BUF_LEN] = "";
  	int	len;
  
  #ifdef FEAT_RIGHTLEFT
  	if (curwin->w_p_rl && *curwin->w_p_rlc == 's')
  	{
  	    if (cur == OUT_OF_TIME)
! 		vim_snprintf(t, SEARCH_STAT_BUF_LEN, "[?/??]");
  	    else if (cnt > 99 && cur > 99)
! 		vim_snprintf(t, SEARCH_STAT_BUF_LEN, "[>99/>99]");
  	    else if (cnt > 99)
! 		vim_snprintf(t, SEARCH_STAT_BUF_LEN, "[>99/%d]", cur);
  	    else
! 		vim_snprintf(t, SEARCH_STAT_BUF_LEN, "[%d/%d]", cnt, cur);
  	}
  	else
  #endif
  	{
  	    if (cur == OUT_OF_TIME)
! 		vim_snprintf(t, SEARCH_STAT_BUF_LEN, "[?/??]");
  	    else if (cnt > 99 && cur > 99)
! 		vim_snprintf(t, SEARCH_STAT_BUF_LEN, "[>99/>99]");
  	    else if (cnt > 99)
! 		vim_snprintf(t, SEARCH_STAT_BUF_LEN, "[%d/>99]", cur);
  	    else
! 		vim_snprintf(t, SEARCH_STAT_BUF_LEN, "[%d/%d]", cur, cnt);
  	}
  
  	len = STRLEN(t);
! 	if (show_top_bot_msg && len + 3 < SEARCH_STAT_BUF_LEN)
  	{
  	    STRCPY(t + len, " W");
  	    len += 2;
*** ../vim-8.1.1288/src/version.c	2019-05-07 21:29:08.427331900 +0200
--- src/version.c	2019-05-07 21:33:53.253784068 +0200
***************
*** 769,770 ****
--- 769,772 ----
  {   /* Add new patch number below this line */
+ /**/
+     1289,
  /**/

-- 
Beer & pretzels can't be served at the same time in any bar or restaurant.
		[real standing law in North Dakota, United States of America]

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