Permalink
Browse files

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
  • Loading branch information...
brammool committed Aug 13, 2017
1 parent 2438ae3 commit e62780543f403186b27b210dd087dd8ba74159fc
Showing with 22 additions and 3 deletions.
  1. +3 −0 src/buffer.c
  2. +17 −3 src/mark.c
  3. +2 −0 src/version.c
View
@@ -5658,6 +5658,9 @@ write_viminfo_bufferlist(FILE *fp)
|| !buf->b_p_bl
#ifdef FEAT_QUICKFIX
|| bt_quickfix(buf)
#endif
#ifdef FEAT_TERMINAL
|| bt_terminal(buf)
#endif
|| removable(buf->b_ffname))
continue;
View
@@ -1649,6 +1649,19 @@ handle_viminfo_mark(garray_T *values, int force)
}
}
/*
* 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_T *buflist)
}
}
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);
View
@@ -769,6 +769,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
930,
/**/
929,
/**/

0 comments on commit e627805

Please sign in to comment.