comparison src/buffer.c @ 12110:7b3a3af7cefb v8.0.0935

patch 8.0.0935: cannot recognize a terminal buffer in :ls output commit https://github.com/vim/vim/commit/304b64c9e6957fa3f552e0540ca786139b39a1c4 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Aug 13 20:43:48 2017 +0200 patch 8.0.0935: cannot recognize a terminal buffer in :ls output Problem: Cannot recognize a terminal buffer in :ls output. Solution: Use R for a running job and F for a finished job.
author Christian Brabandt <cb@256bit.org>
date Sun, 13 Aug 2017 20:45:04 +0200
parents d4ffc3dc9fb0
children 59c1e09cf1a9
comparison
equal deleted inserted replaced
12109:b1f1b87b48d2 12110:7b3a3af7cefb
3032 buflist_list(exarg_T *eap) 3032 buflist_list(exarg_T *eap)
3033 { 3033 {
3034 buf_T *buf; 3034 buf_T *buf;
3035 int len; 3035 int len;
3036 int i; 3036 int i;
3037 int ro_char;
3038 int changed_char;
3037 3039
3038 for (buf = firstbuf; buf != NULL && !got_int; buf = buf->b_next) 3040 for (buf = firstbuf; buf != NULL && !got_int; buf = buf->b_next)
3039 { 3041 {
3040 /* skip unlisted buffers, unless ! was used */ 3042 /* skip unlisted buffers, unless ! was used */
3041 if ((!buf->b_p_bl && !eap->forceit && !vim_strchr(eap->arg, 'u')) 3043 if ((!buf->b_p_bl && !eap->forceit && !vim_strchr(eap->arg, 'u'))
3058 else 3060 else
3059 home_replace(buf, buf->b_fname, NameBuff, MAXPATHL, TRUE); 3061 home_replace(buf, buf->b_fname, NameBuff, MAXPATHL, TRUE);
3060 if (message_filtered(NameBuff)) 3062 if (message_filtered(NameBuff))
3061 continue; 3063 continue;
3062 3064
3065 changed_char = (buf->b_flags & BF_READERR) ? 'x'
3066 : (bufIsChanged(buf) ? '+' : ' ');
3067 #ifdef FEAT_TERMINAL
3068 if (term_job_running(buf->b_term))
3069 {
3070 ro_char = 'R';
3071 changed_char = ' '; /* bufIsChanged() returns TRUE to avoid
3072 * closing, but it's not actually changed. */
3073 }
3074 else if (buf->b_term != NULL)
3075 ro_char = 'F';
3076 else
3077 #endif
3078 ro_char = !buf->b_p_ma ? '-' : (buf->b_p_ro ? '=' : ' ');
3079
3063 msg_putchar('\n'); 3080 msg_putchar('\n');
3064 len = vim_snprintf((char *)IObuff, IOSIZE - 20, "%3d%c%c%c%c%c \"%s\"", 3081 len = vim_snprintf((char *)IObuff, IOSIZE - 20, "%3d%c%c%c%c%c \"%s\"",
3065 buf->b_fnum, 3082 buf->b_fnum,
3066 buf->b_p_bl ? ' ' : 'u', 3083 buf->b_p_bl ? ' ' : 'u',
3067 buf == curbuf ? '%' : 3084 buf == curbuf ? '%' :
3068 (curwin->w_alt_fnum == buf->b_fnum ? '#' : ' '), 3085 (curwin->w_alt_fnum == buf->b_fnum ? '#' : ' '),
3069 buf->b_ml.ml_mfp == NULL ? ' ' : 3086 buf->b_ml.ml_mfp == NULL ? ' ' :
3070 (buf->b_nwindows == 0 ? 'h' : 'a'), 3087 (buf->b_nwindows == 0 ? 'h' : 'a'),
3071 !buf->b_p_ma ? '-' : (buf->b_p_ro ? '=' : ' '), 3088 ro_char,
3072 (buf->b_flags & BF_READERR) ? 'x' 3089 changed_char,
3073 : (bufIsChanged(buf) ? '+' : ' '),
3074 NameBuff); 3090 NameBuff);
3075 if (len > IOSIZE - 20) 3091 if (len > IOSIZE - 20)
3076 len = IOSIZE - 20; 3092 len = IOSIZE - 20;
3077 3093
3078 /* put "line 999" in column 40 or after the file name */ 3094 /* put "line 999" in column 40 or after the file name */