comparison src/buffer.c @ 27018:268f6a3511df v8.2.4038

patch 8.2.4038: various code not used when features are disabled Commit: https://github.com/vim/vim/commit/748b308eebe8d8860888eb27da08333f175d547d Author: Dominique Pelle <dominique.pelle@gmail.com> Date: Sat Jan 8 12:41:16 2022 +0000 patch 8.2.4038: various code not used when features are disabled Problem: Various code not used when features are disabled. Solution: Add #ifdefs. (Dominique Pell?, closes https://github.com/vim/vim/issues/9491)
author Bram Moolenaar <Bram@vim.org>
date Sat, 08 Jan 2022 13:45:04 +0100
parents 7f150a4936f2
children 8f1f4f6c87ad
comparison
equal deleted inserted replaced
27017:da790d50f73d 27018:268f6a3511df
136 } 136 }
137 } 137 }
138 return retval; 138 return retval;
139 } 139 }
140 140
141 #if defined(FEAT_EVAL) || defined(PROTO)
141 /* 142 /*
142 * Ensure buffer "buf" is loaded. Does not trigger the swap-exists action. 143 * Ensure buffer "buf" is loaded. Does not trigger the swap-exists action.
143 */ 144 */
144 void 145 void
145 buffer_ensure_loaded(buf_T *buf) 146 buffer_ensure_loaded(buf_T *buf)
152 swap_exists_action = SEA_NONE; 153 swap_exists_action = SEA_NONE;
153 open_buffer(FALSE, NULL, 0); 154 open_buffer(FALSE, NULL, 0);
154 aucmd_restbuf(&aco); 155 aucmd_restbuf(&aco);
155 } 156 }
156 } 157 }
158 #endif
157 159
158 /* 160 /*
159 * Open current buffer, that is: open the memfile and read the file into 161 * Open current buffer, that is: open the memfile and read the file into
160 * memory. 162 * memory.
161 * Return FAIL for failure, OK otherwise. 163 * Return FAIL for failure, OK otherwise.
5607 bt_prompt(buf_T *buf) 5609 bt_prompt(buf_T *buf)
5608 { 5610 {
5609 return buf != NULL && buf->b_p_bt[0] == 'p' && buf->b_p_bt[1] == 'r'; 5611 return buf != NULL && buf->b_p_bt[0] == 'p' && buf->b_p_bt[1] == 'r';
5610 } 5612 }
5611 5613
5614 #if defined(FEAT_PROP_POPUP) || defined(PROTO)
5612 /* 5615 /*
5613 * Return TRUE if "buf" is a buffer for a popup window. 5616 * Return TRUE if "buf" is a buffer for a popup window.
5614 */ 5617 */
5615 int 5618 int
5616 bt_popup(buf_T *buf) 5619 bt_popup(buf_T *buf)
5617 { 5620 {
5618 return buf != NULL && buf->b_p_bt != NULL 5621 return buf != NULL && buf->b_p_bt != NULL
5619 && buf->b_p_bt[0] == 'p' && buf->b_p_bt[1] == 'o'; 5622 && buf->b_p_bt[0] == 'p' && buf->b_p_bt[1] == 'o';
5620 } 5623 }
5624 #endif
5621 5625
5622 /* 5626 /*
5623 * Return TRUE if "buf" is a "nofile", "acwrite", "terminal" or "prompt" 5627 * Return TRUE if "buf" is a "nofile", "acwrite", "terminal" or "prompt"
5624 * buffer. This means the buffer name is not a file name. 5628 * buffer. This means the buffer name is not a file name.
5625 */ 5629 */
5630 || buf->b_p_bt[0] == 'a' 5634 || buf->b_p_bt[0] == 'a'
5631 || buf->b_p_bt[0] == 't' 5635 || buf->b_p_bt[0] == 't'
5632 || buf->b_p_bt[0] == 'p'); 5636 || buf->b_p_bt[0] == 'p');
5633 } 5637 }
5634 5638
5639 #if defined(FEAT_QUICKFIX) || defined(PROTO)
5635 /* 5640 /*
5636 * Return TRUE if "buf" has 'buftype' set to "nofile". 5641 * Return TRUE if "buf" has 'buftype' set to "nofile".
5637 */ 5642 */
5638 int 5643 int
5639 bt_nofile(buf_T *buf) 5644 bt_nofile(buf_T *buf)
5640 { 5645 {
5641 return buf != NULL && buf->b_p_bt[0] == 'n' && buf->b_p_bt[2] == 'f'; 5646 return buf != NULL && buf->b_p_bt[0] == 'n' && buf->b_p_bt[2] == 'f';
5642 } 5647 }
5648 #endif
5643 5649
5644 /* 5650 /*
5645 * Return TRUE if "buf" is a "nowrite", "nofile", "terminal" or "prompt" 5651 * Return TRUE if "buf" is a "nowrite", "nofile", "terminal" or "prompt"
5646 * buffer. 5652 * buffer.
5647 */ 5653 */