comparison src/buffer.c @ 13555:78ead137b2ad v8.0.1651

patch 8.0.1651: cannot filter :ls output for terminal buffers commit https://github.com/vim/vim/commit/0751f51a5b428805a8c1e9fe529693d032bec991 Author: Bram Moolenaar <Bram@vim.org> Date: Thu Mar 29 16:37:16 2018 +0200 patch 8.0.1651: cannot filter :ls output for terminal buffers Problem: Cannot filter :ls output for terminal buffers. Solution: Add flags for terminal buffers. (Marcin Szamotulski, closes https://github.com/vim/vim/issues/2751)
author Christian Brabandt <cb@256bit.org>
date Thu, 29 Mar 2018 16:45:06 +0200
parents 04019fc3de93
children cec5137d5332
comparison
equal deleted inserted replaced
13554:c5b436c481f4 13555:78ead137b2ad
2928 buf_T *buf; 2928 buf_T *buf;
2929 int len; 2929 int len;
2930 int i; 2930 int i;
2931 int ro_char; 2931 int ro_char;
2932 int changed_char; 2932 int changed_char;
2933 #ifdef FEAT_TERMINAL
2934 int job_running;
2935 int job_none_open;
2936 #endif
2933 2937
2934 for (buf = firstbuf; buf != NULL && !got_int; buf = buf->b_next) 2938 for (buf = firstbuf; buf != NULL && !got_int; buf = buf->b_next)
2935 { 2939 {
2940 #ifdef FEAT_TERMINAL
2941 job_running = term_job_running(buf->b_term);
2942 job_none_open = job_running && term_none_open(buf->b_term);
2943 #endif
2936 /* skip unlisted buffers, unless ! was used */ 2944 /* skip unlisted buffers, unless ! was used */
2937 if ((!buf->b_p_bl && !eap->forceit && !vim_strchr(eap->arg, 'u')) 2945 if ((!buf->b_p_bl && !eap->forceit && !vim_strchr(eap->arg, 'u'))
2938 || (vim_strchr(eap->arg, 'u') && buf->b_p_bl) 2946 || (vim_strchr(eap->arg, 'u') && buf->b_p_bl)
2939 || (vim_strchr(eap->arg, '+') 2947 || (vim_strchr(eap->arg, '+')
2940 && ((buf->b_flags & BF_READERR) || !bufIsChanged(buf))) 2948 && ((buf->b_flags & BF_READERR) || !bufIsChanged(buf)))
2941 || (vim_strchr(eap->arg, 'a') 2949 || (vim_strchr(eap->arg, 'a')
2942 && (buf->b_ml.ml_mfp == NULL || buf->b_nwindows == 0)) 2950 && (buf->b_ml.ml_mfp == NULL || buf->b_nwindows == 0))
2943 || (vim_strchr(eap->arg, 'h') 2951 || (vim_strchr(eap->arg, 'h')
2944 && (buf->b_ml.ml_mfp == NULL || buf->b_nwindows != 0)) 2952 && (buf->b_ml.ml_mfp == NULL || buf->b_nwindows != 0))
2953 #ifdef FEAT_TERMINAL
2954 || (vim_strchr(eap->arg, 'R')
2955 && (!job_running || (job_running && job_none_open)))
2956 || (vim_strchr(eap->arg, '?')
2957 && (!job_running || (job_running && !job_none_open)))
2958 || (vim_strchr(eap->arg, 'F')
2959 && (job_running || buf->b_term == NULL))
2960 #endif
2945 || (vim_strchr(eap->arg, '-') && buf->b_p_ma) 2961 || (vim_strchr(eap->arg, '-') && buf->b_p_ma)
2946 || (vim_strchr(eap->arg, '=') && !buf->b_p_ro) 2962 || (vim_strchr(eap->arg, '=') && !buf->b_p_ro)
2947 || (vim_strchr(eap->arg, 'x') && !(buf->b_flags & BF_READERR)) 2963 || (vim_strchr(eap->arg, 'x') && !(buf->b_flags & BF_READERR))
2948 || (vim_strchr(eap->arg, '%') && buf != curbuf) 2964 || (vim_strchr(eap->arg, '%') && buf != curbuf)
2949 || (vim_strchr(eap->arg, '#') 2965 || (vim_strchr(eap->arg, '#')