diff options
author | Justin M. Keyes <justinkz@gmail.com> | 2019-06-29 21:03:38 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-06-29 21:03:38 +0200 |
commit | 2d4a37ebab354afb94dfe600b302d8a2b1f2d889 (patch) | |
tree | fb6c12cef807625b9008487389c3eefd42a8b6af /src/nvim/buffer.c | |
parent | c207095445286321cbb319ab1498c34b204760cf (diff) | |
download | rneovim-2d4a37ebab354afb94dfe600b302d8a2b1f2d889.tar.gz rneovim-2d4a37ebab354afb94dfe600b302d8a2b1f2d889.tar.bz2 rneovim-2d4a37ebab354afb94dfe600b302d8a2b1f2d889.zip |
:ls : show "R", "F" for terminal-jobs #10370
This matches Vim behavior. From `:help :ls` :
R a terminal buffer with a running job
F a terminal buffer with a finished job
? a terminal buffer without a job: `:terminal NONE`
TODO: implement `:terminal NONE`.
ref #10349
Diffstat (limited to 'src/nvim/buffer.c')
-rw-r--r-- | src/nvim/buffer.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 043ae420cd..5678f518f5 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -29,6 +29,7 @@ #include "nvim/api/vim.h" #include "nvim/ascii.h" #include "nvim/assert.h" +#include "nvim/channel.h" #include "nvim/vim.h" #include "nvim/buffer.h" #include "nvim/charset.h" @@ -2608,9 +2609,10 @@ void buflist_list(exarg_T *eap) const int changed_char = (buf->b_flags & BF_READERR) ? 'x' : (bufIsChanged(buf) ? '+' : ' '); - const int ro_char = !MODIFIABLE(buf) - ? '-' - : (buf->b_p_ro ? '=' : ' '); + int ro_char = !MODIFIABLE(buf) ? '-' : (buf->b_p_ro ? '=' : ' '); + if (buf->terminal) { + ro_char = channel_job_running((uint64_t)buf->b_p_channel) ? 'R' : 'F'; + } msg_putchar('\n'); len = vim_snprintf( |