comparison src/quickfix.c @ 11788:77bf0346687e v8.0.0776

patch 8.0.0776: function prototypes missing without the quickfix feature commit https://github.com/vim/vim/commit/f0a521f4f76904edb74e182c12732189b347ff68 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jul 25 23:31:12 2017 +0200 patch 8.0.0776: function prototypes missing without the quickfix feature Problem: Function prototypes missing without the quickfix feature. (Tony Mechelynck) Solution: Move non-quickfix functions to buffer.c.
author Christian Brabandt <cb@256bit.org>
date Tue, 25 Jul 2017 23:45:04 +0200
parents 74abb6c84984
children 5ceaecedbad2
comparison
equal deleted inserted replaced
11787:c3c09047d106 11788:77bf0346687e
5524 curwin->w_llist = qi; 5524 curwin->w_llist = qi;
5525 } 5525 }
5526 } 5526 }
5527 5527
5528 #endif /* FEAT_QUICKFIX */ 5528 #endif /* FEAT_QUICKFIX */
5529
5530 /*
5531 * Return TRUE if "buf" is the quickfix buffer.
5532 */
5533 int
5534 bt_quickfix(buf_T *buf)
5535 {
5536 return buf != NULL && buf->b_p_bt[0] == 'q';
5537 }
5538
5539 /*
5540 * Return TRUE if "buf" is a terminal buffer.
5541 */
5542 int
5543 bt_terminal(buf_T *buf)
5544 {
5545 return buf != NULL && buf->b_p_bt[0] == 't';
5546 }
5547
5548 /*
5549 * Return TRUE if "buf" is a "nofile", "acwrite" or "terminal" buffer.
5550 * This means the buffer name is not a file name.
5551 */
5552 int
5553 bt_nofile(buf_T *buf)
5554 {
5555 return buf != NULL && ((buf->b_p_bt[0] == 'n' && buf->b_p_bt[2] == 'f')
5556 || buf->b_p_bt[0] == 'a'
5557 || buf->b_p_bt[0] == 't');
5558 }
5559
5560 /*
5561 * Return TRUE if "buf" is a "nowrite", "nofile" or "terminal" buffer.
5562 */
5563 int
5564 bt_dontwrite(buf_T *buf)
5565 {
5566 return buf != NULL && (buf->b_p_bt[0] == 'n' || buf->b_p_bt[0] == 't');
5567 }
5568
5569 int
5570 bt_dontwrite_msg(buf_T *buf)
5571 {
5572 if (bt_dontwrite(buf))
5573 {
5574 EMSG(_("E382: Cannot write, 'buftype' option is set"));
5575 return TRUE;
5576 }
5577 return FALSE;
5578 }
5579
5580 /*
5581 * Return TRUE if the buffer should be hidden, according to 'hidden', ":hide"
5582 * and 'bufhidden'.
5583 */
5584 int
5585 buf_hide(buf_T *buf)
5586 {
5587 /* 'bufhidden' overrules 'hidden' and ":hide", check it first */
5588 switch (buf->b_p_bh[0])
5589 {
5590 case 'u': /* "unload" */
5591 case 'w': /* "wipe" */
5592 case 'd': return FALSE; /* "delete" */
5593 case 'h': return TRUE; /* "hide" */
5594 }
5595 return (p_hid || cmdmod.hide);
5596 }
5597