]> granicus.if.org Git - vim/commitdiff
patch 8.0.0935: cannot recognize a terminal buffer in :ls output v8.0.0935
authorBram Moolenaar <Bram@vim.org>
Sun, 13 Aug 2017 18:43:48 +0000 (20:43 +0200)
committerBram Moolenaar <Bram@vim.org>
Sun, 13 Aug 2017 18:43:48 +0000 (20:43 +0200)
Problem:    Cannot recognize a terminal buffer in :ls output.
Solution:   Use R for a running job and F for a finished job.

src/buffer.c
src/version.c

index a33b349d9dd08d104b814affe7952616827bac1c..3934941565fdb1d894597bfa401e5dcfc2acd2d4 100644 (file)
@@ -3034,6 +3034,8 @@ buflist_list(exarg_T *eap)
     buf_T      *buf;
     int                len;
     int                i;
+    int                ro_char;
+    int                changed_char;
 
     for (buf = firstbuf; buf != NULL && !got_int; buf = buf->b_next)
     {
@@ -3060,6 +3062,21 @@ buflist_list(exarg_T *eap)
        if (message_filtered(NameBuff))
            continue;
 
+       changed_char = (buf->b_flags & BF_READERR) ? 'x'
+                                            : (bufIsChanged(buf) ? '+' : ' ');
+#ifdef FEAT_TERMINAL
+       if (term_job_running(buf->b_term))
+       {
+           ro_char = 'R';
+           changed_char = ' ';  /* bufIsChanged() returns TRUE to avoid
+                                 * closing, but it's not actually changed. */
+       }
+       else if (buf->b_term != NULL)
+           ro_char = 'F';
+       else
+#endif
+           ro_char = !buf->b_p_ma ? '-' : (buf->b_p_ro ? '=' : ' ');
+
        msg_putchar('\n');
        len = vim_snprintf((char *)IObuff, IOSIZE - 20, "%3d%c%c%c%c%c \"%s\"",
                buf->b_fnum,
@@ -3068,9 +3085,8 @@ buflist_list(exarg_T *eap)
                        (curwin->w_alt_fnum == buf->b_fnum ? '#' : ' '),
                buf->b_ml.ml_mfp == NULL ? ' ' :
                        (buf->b_nwindows == 0 ? 'h' : 'a'),
-               !buf->b_p_ma ? '-' : (buf->b_p_ro ? '=' : ' '),
-               (buf->b_flags & BF_READERR) ? 'x'
-                                           : (bufIsChanged(buf) ? '+' : ' '),
+               ro_char,
+               changed_char,
                NameBuff);
        if (len > IOSIZE - 20)
            len = IOSIZE - 20;
index a24b6715bcd7398b282203d6ef742d9213cf8837..61ee3c06e0efd047ebf704b652a1f03625a32f3f 100644 (file)
@@ -769,6 +769,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    935,
 /**/
     934,
 /**/