summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0230
blob: 315207b0f7688831acd57788e0093f1262fa2feb (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
145
146
147
148
149
150
151
152
153
154
155
156
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0230
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.0230
Problem:    Directly checking 'buftype' value.
Solution:   Add the bt_normal() function. (Yegappan Lakshmanan)
Files:	    src/buffer.c, src/ex_docmd.c, src/fileio.c, src/proto/buffer.pro,
            src/quickfix.c

*** ../vim-8.1.0229/src/buffer.c	2018-06-23 19:22:45.598486362 +0200
--- src/buffer.c	2018-08-01 17:39:05.854918677 +0200
***************
*** 5627,5632 ****
--- 5627,5641 ----
  #endif
  
  /*
+  * Return TRUE if "buf" is a normal buffer, 'buftype' is empty.
+  */
+     int
+ bt_normal(buf_T *buf)
+ {
+     return buf != NULL && buf->b_p_bt[0] == NUL;
+ }
+ 
+ /*
   * Return TRUE if "buf" is the quickfix buffer.
   */
      int
*** ../vim-8.1.0229/src/ex_docmd.c	2018-07-29 17:35:19.493750319 +0200
--- src/ex_docmd.c	2018-08-01 17:37:07.895552456 +0200
***************
*** 11768,11774 ****
       */
      if ((*flagp & SSOP_FOLDS)
  	    && wp->w_buffer->b_ffname != NULL
! 	    && (*wp->w_buffer->b_p_bt == NUL || bt_help(wp->w_buffer)))
      {
  	if (put_folds(fd, wp) == FAIL)
  	    return FAIL;
--- 11768,11774 ----
       */
      if ((*flagp & SSOP_FOLDS)
  	    && wp->w_buffer->b_ffname != NULL
! 	    && (bt_normal(wp->w_buffer) || bt_help(wp->w_buffer)))
      {
  	if (put_folds(fd, wp) == FAIL)
  	    return FAIL;
*** ../vim-8.1.0229/src/fileio.c	2018-07-07 18:34:08.430551330 +0200
--- src/fileio.c	2018-08-01 17:37:07.899552434 +0200
***************
*** 6897,6903 ****
       * this buffer. */
      if (buf->b_ffname == NULL
  	    || buf->b_ml.ml_mfp == NULL
! 	    || *buf->b_p_bt != NUL
  	    || buf->b_saving
  	    || busy
  #ifdef FEAT_NETBEANS_INTG
--- 6897,6903 ----
       * this buffer. */
      if (buf->b_ffname == NULL
  	    || buf->b_ml.ml_mfp == NULL
! 	    || !bt_normal(buf)
  	    || buf->b_saving
  	    || busy
  #ifdef FEAT_NETBEANS_INTG
*** ../vim-8.1.0229/src/proto/buffer.pro	2018-06-03 14:42:17.848505102 +0200
--- src/proto/buffer.pro	2018-08-01 17:39:55.638650591 +0200
***************
*** 56,61 ****
--- 56,62 ----
  void do_modelines(int flags);
  int read_viminfo_bufferlist(vir_T *virp, int writing);
  void write_viminfo_bufferlist(FILE *fp);
+ int bt_normal(buf_T *buf);
  int bt_quickfix(buf_T *buf);
  int bt_terminal(buf_T *buf);
  int bt_help(buf_T *buf);
*** ../vim-8.1.0229/src/quickfix.c	2018-07-25 22:36:48.991518559 +0200
--- src/quickfix.c	2018-08-01 17:37:07.899552434 +0200
***************
*** 2487,2493 ****
      win_T	*wp;
  
      FOR_ALL_WINDOWS(wp)
! 	if (wp->w_buffer->b_p_bt[0] == NUL)
  	    return wp;
  
      return NULL;
--- 2487,2493 ----
      win_T	*wp;
  
      FOR_ALL_WINDOWS(wp)
! 	if (bt_normal(wp->w_buffer))
  	    return wp;
  
      return NULL;
***************
*** 2563,2569 ****
  	    win = curwin;
  	    do
  	    {
! 		if (win->w_buffer->b_p_bt[0] == NUL)
  		    break;
  		if (win->w_prev == NULL)
  		    win = lastwin;	/* wrap around the top */
--- 2563,2569 ----
  	    win = curwin;
  	    do
  	    {
! 		if (bt_normal(win->w_buffer))
  		    break;
  		if (win->w_prev == NULL)
  		    win = lastwin;	/* wrap around the top */
***************
*** 2620,2627 ****
  	}
  
  	/* Remember a usable window. */
! 	if (altwin == NULL && !win->w_p_pvw
! 		&& win->w_buffer->b_p_bt[0] == NUL)
  	    altwin = win;
      }
  
--- 2620,2626 ----
  	}
  
  	/* Remember a usable window. */
! 	if (altwin == NULL && !win->w_p_pvw && bt_normal(win->w_buffer))
  	    altwin = win;
      }
  
*** ../vim-8.1.0229/src/version.c	2018-07-29 17:40:37.239467625 +0200
--- src/version.c	2018-08-01 17:38:23.335147376 +0200
***************
*** 796,797 ****
--- 796,799 ----
  {   /* Add new patch number below this line */
+ /**/
+     230,
  /**/

-- 
Individualists unite!

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