# HG changeset patch # User Christian Brabandt # Date 1502640903 -7200 # Node ID d4ffc3dc9fb059a58c9da7db8d7c2096ef04e48a # Parent 3aed6fd3a25d0d78d46b21bbf645291518906653 patch 8.0.0930: terminal buffers are stored in the viminfo file commit https://github.com/vim/vim/commit/e62780543f403186b27b210dd087dd8ba74159fc Author: Bram Moolenaar Date: Sun Aug 13 18:11:17 2017 +0200 patch 8.0.0930: terminal buffers are stored in the viminfo file Problem: Terminal buffers are stored in the viminfo file while they can't be useful. Solution: Skip terminal buffers for file marks and buffer list diff --git a/src/buffer.c b/src/buffer.c --- a/src/buffer.c +++ b/src/buffer.c @@ -5659,6 +5659,9 @@ write_viminfo_bufferlist(FILE *fp) #ifdef FEAT_QUICKFIX || bt_quickfix(buf) #endif +#ifdef FEAT_TERMINAL + || bt_terminal(buf) +#endif || removable(buf->b_ffname)) continue; diff --git a/src/mark.c b/src/mark.c --- a/src/mark.c +++ b/src/mark.c @@ -1649,6 +1649,19 @@ handle_viminfo_mark(garray_T *values, in } } +/* + * Return TRUE if marks for "buf" should not be written. + */ + static int +skip_for_viminfo(buf_T *buf) +{ + return +#ifdef FEAT_TERMINAL + bt_terminal(buf) || +#endif + removable(buf->b_ffname); +} + void write_viminfo_filemarks(FILE *fp) { @@ -1681,7 +1694,7 @@ write_viminfo_filemarks(FILE *fp) * Move '0 to '1, '1 to '2, etc. until the matching one or '9 * Set the '0 mark to current cursor position. */ - if (curbuf->b_ffname != NULL && !removable(curbuf->b_ffname)) + if (curbuf->b_ffname != NULL && !skip_for_viminfo(curbuf)) { name = buflist_nr2name(curbuf->b_fnum, TRUE, FALSE); for (i = NMARKS; i < NMARKS + EXTRA_MARKS - 1; ++i) @@ -1757,7 +1770,7 @@ write_viminfo_filemarks(FILE *fp) --idx; if (fm->fmark.fnum == 0 || ((buf = buflist_findnr(fm->fmark.fnum)) != NULL - && !removable(buf->b_ffname))) + && !skip_for_viminfo(buf))) write_one_filemark(fp, fm, '-', '\''); } #endif @@ -1917,7 +1930,8 @@ write_viminfo_marks(FILE *fp_out, garray } } if (is_mark_set && buf->b_ffname != NULL - && buf->b_ffname[0] != NUL && !removable(buf->b_ffname)) + && buf->b_ffname[0] != NUL + && !skip_for_viminfo(buf)) { if (buflist == NULL) write_buffer_marks(buf, fp_out); diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -770,6 +770,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 930, +/**/ 929, /**/ 928,