diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-07-23 19:51:01 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-07-23 19:51:01 +0200 |
commit | 1f2903c43109b16594d141a730659317b15f388d (patch) | |
tree | 35ce24b99f05f54f9f51d6f3e8ed21417787019c /src/buffer.c | |
parent | 065f41c8143271d1af7c8f5d14a59e29bf7ecdf3 (diff) | |
download | vim-git-1f2903c43109b16594d141a730659317b15f388d.tar.gz |
patch 8.0.0761: options not set properly for a terminal bufferv8.0.0761
Problem: Options of a buffer for a terminal window are not set properly.
Solution: Add "terminal" value for 'buftype'. Make 'buftype' and
'bufhidden' not depend on the quickfix feature.
Also set the buffer name and show "running" or "finished" in the
window title.
Diffstat (limited to 'src/buffer.c')
-rw-r--r-- | src/buffer.c | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/src/buffer.c b/src/buffer.c index dbd4d3ae9..ae23db080 100644 --- a/src/buffer.c +++ b/src/buffer.c @@ -468,7 +468,6 @@ close_buffer( int del_buf = (action == DOBUF_DEL || action == DOBUF_WIPE); int wipe_buf = (action == DOBUF_WIPE); -#ifdef FEAT_QUICKFIX /* * Force unloading or deleting when 'bufhidden' says so. * The caller must take care of NOT deleting/freeing when 'bufhidden' is @@ -487,7 +486,6 @@ close_buffer( } else if (buf->b_p_bh[0] == 'u') /* 'bufhidden' == "unload" */ unload_buf = TRUE; -#endif #ifdef FEAT_AUTOCMD /* Disallow deleting the buffer when it is locked (already being closed or @@ -1982,16 +1980,14 @@ buflist_new( return NULL; # endif #endif -#ifdef FEAT_QUICKFIX -# ifdef FEAT_AUTOCMD +#ifdef FEAT_AUTOCMD if (buf == curbuf) -# endif +#endif { /* Make sure 'bufhidden' and 'buftype' are empty */ clear_string_option(&buf->b_p_bh); clear_string_option(&buf->b_p_bt); } -#endif } if (buf != curbuf || curbuf == NULL) { @@ -2165,10 +2161,8 @@ free_buf_options( clear_string_option(&buf->b_p_fenc); #endif clear_string_option(&buf->b_p_ff); -#ifdef FEAT_QUICKFIX clear_string_option(&buf->b_p_bh); clear_string_option(&buf->b_p_bt); -#endif } #ifdef FEAT_FIND_ID clear_string_option(&buf->b_p_def); @@ -3668,9 +3662,21 @@ maketitle(void) /* remove the file name */ p = gettail_sep(buf + off); if (p == buf + off) - /* must be a help buffer */ - vim_strncpy(buf + off, (char_u *)_("help"), + { + char *txt; + +#ifdef FEAT_TERMINAL + if (curbuf->b_term != NULL) + txt = term_job_running(curbuf) + ? _("running") : _("finished"); + else +#endif + txt = _("help"); + + /* must be a help or terminal buffer */ + vim_strncpy(buf + off, (char_u *)txt, (size_t)(SPACE_FOR_DIR - off - 1)); + } else *p = NUL; |