diff options
author | Bram Moolenaar <Bram@vim.org> | 2018-06-03 14:47:35 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2018-06-03 14:47:35 +0200 |
commit | f273245f6433d5d43a5671306b520a3230c35787 (patch) | |
tree | 958293fed4c59ee0cb91a491c8c0e32aa0e618c2 /src/buffer.c | |
parent | 33c5e9fa7af935c61a8aac461b9664c501003440 (diff) |
patch 8.1.0027: difficult to make a plugin that feeds a line to a jobv8.1.0027
Problem: Difficult to make a plugin that feeds a line to a job.
Solution: Add the nitial code for the "prompt" buftype.
Diffstat (limited to 'src/buffer.c')
-rw-r--r-- | src/buffer.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/buffer.c b/src/buffer.c index e3cbdac1e8..1c55acbaf2 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -851,6 +851,10 @@ free_buffer(buf_T *buf) #ifdef FEAT_TERMINAL free_terminal(buf); #endif +#ifdef FEAT_JOB_CHANNEL + vim_free(buf->b_prompt_text); + free_callback(buf->b_prompt_callback, buf->b_prompt_partial); +#endif buf_hashtab_remove(buf); @@ -5634,6 +5638,15 @@ bt_help(buf_T *buf) } /* + * Return TRUE if "buf" is a prompt buffer. + */ + int +bt_prompt(buf_T *buf) +{ + return buf != NULL && buf->b_p_bt[0] == 'p'; +} + +/* * Return TRUE if "buf" is a "nofile", "acwrite" or "terminal" buffer. * This means the buffer name is not a file name. */ @@ -5642,7 +5655,8 @@ bt_nofile(buf_T *buf) { return buf != NULL && ((buf->b_p_bt[0] == 'n' && buf->b_p_bt[2] == 'f') || buf->b_p_bt[0] == 'a' - || buf->b_p_bt[0] == 't'); + || buf->b_p_bt[0] == 't' + || buf->b_p_bt[0] == 'p'); } /* @@ -5651,7 +5665,9 @@ bt_nofile(buf_T *buf) int bt_dontwrite(buf_T *buf) { - return buf != NULL && (buf->b_p_bt[0] == 'n' || buf->b_p_bt[0] == 't'); + return buf != NULL && (buf->b_p_bt[0] == 'n' + || buf->b_p_bt[0] == 't' + || buf->b_p_bt[0] == 'p'); } int |