Mercurial > vim
comparison src/buffer.c @ 6945:957a3bb312fa v7.4.791
patch 7.4.791
Problem: The buffer list can be very long.
Solution: Add an argument to ":ls" to specify the type of buffer to list.
(Marcin Szamotulski)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Tue, 21 Jul 2015 15:03:06 +0200 |
parents | 62ba356c2d4e |
children | 7b5f9313f40b |
comparison
equal
deleted
inserted
replaced
6944:2e7b340bdba5 | 6945:957a3bb312fa |
---|---|
2759 int i; | 2759 int i; |
2760 | 2760 |
2761 for (buf = firstbuf; buf != NULL && !got_int; buf = buf->b_next) | 2761 for (buf = firstbuf; buf != NULL && !got_int; buf = buf->b_next) |
2762 { | 2762 { |
2763 /* skip unlisted buffers, unless ! was used */ | 2763 /* skip unlisted buffers, unless ! was used */ |
2764 if (!buf->b_p_bl && !eap->forceit) | 2764 if ((!buf->b_p_bl && !eap->forceit && !vim_strchr(eap->arg, 'u')) |
2765 || (vim_strchr(eap->arg, 'u') && buf->b_p_bl) | |
2766 || (vim_strchr(eap->arg, '+') | |
2767 && ((buf->b_flags & BF_READERR) || !bufIsChanged(buf))) | |
2768 || (vim_strchr(eap->arg, 'a') | |
2769 && (buf->b_ml.ml_mfp == NULL || buf->b_nwindows == 0)) | |
2770 || (vim_strchr(eap->arg, 'h') | |
2771 && (buf->b_ml.ml_mfp == NULL || buf->b_nwindows != 0)) | |
2772 || (vim_strchr(eap->arg, '-') && buf->b_p_ma) | |
2773 || (vim_strchr(eap->arg, '=') && !buf->b_p_ro) | |
2774 || (vim_strchr(eap->arg, 'x') && !(buf->b_flags & BF_READERR)) | |
2775 || (vim_strchr(eap->arg, '%') && buf != curbuf) | |
2776 || (vim_strchr(eap->arg, '#') | |
2777 && (buf == curbuf || curwin->w_alt_fnum != buf->b_fnum))) | |
2765 continue; | 2778 continue; |
2766 msg_putchar('\n'); | 2779 msg_putchar('\n'); |
2767 if (buf_spname(buf) != NULL) | 2780 if (buf_spname(buf) != NULL) |
2768 vim_strncpy(NameBuff, buf_spname(buf), MAXPATHL - 1); | 2781 vim_strncpy(NameBuff, buf_spname(buf), MAXPATHL - 1); |
2769 else | 2782 else |