mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
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
This commit is contained in:
parent
2438ae3d67
commit
e62780543f
@ -5658,6 +5658,9 @@ write_viminfo_bufferlist(FILE *fp)
|
|||||||
|| !buf->b_p_bl
|
|| !buf->b_p_bl
|
||||||
#ifdef FEAT_QUICKFIX
|
#ifdef FEAT_QUICKFIX
|
||||||
|| bt_quickfix(buf)
|
|| bt_quickfix(buf)
|
||||||
|
#endif
|
||||||
|
#ifdef FEAT_TERMINAL
|
||||||
|
|| bt_terminal(buf)
|
||||||
#endif
|
#endif
|
||||||
|| removable(buf->b_ffname))
|
|| removable(buf->b_ffname))
|
||||||
continue;
|
continue;
|
||||||
|
20
src/mark.c
20
src/mark.c
@ -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
|
void
|
||||||
write_viminfo_filemarks(FILE *fp)
|
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
|
* Move '0 to '1, '1 to '2, etc. until the matching one or '9
|
||||||
* Set the '0 mark to current cursor position.
|
* 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);
|
name = buflist_nr2name(curbuf->b_fnum, TRUE, FALSE);
|
||||||
for (i = NMARKS; i < NMARKS + EXTRA_MARKS - 1; ++i)
|
for (i = NMARKS; i < NMARKS + EXTRA_MARKS - 1; ++i)
|
||||||
@ -1757,7 +1770,7 @@ write_viminfo_filemarks(FILE *fp)
|
|||||||
--idx;
|
--idx;
|
||||||
if (fm->fmark.fnum == 0
|
if (fm->fmark.fnum == 0
|
||||||
|| ((buf = buflist_findnr(fm->fmark.fnum)) != NULL
|
|| ((buf = buflist_findnr(fm->fmark.fnum)) != NULL
|
||||||
&& !removable(buf->b_ffname)))
|
&& !skip_for_viminfo(buf)))
|
||||||
write_one_filemark(fp, fm, '-', '\'');
|
write_one_filemark(fp, fm, '-', '\'');
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -1917,7 +1930,8 @@ write_viminfo_marks(FILE *fp_out, garray_T *buflist)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (is_mark_set && buf->b_ffname != NULL
|
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)
|
if (buflist == NULL)
|
||||||
write_buffer_marks(buf, fp_out);
|
write_buffer_marks(buf, fp_out);
|
||||||
|
@ -769,6 +769,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
930,
|
||||||
/**/
|
/**/
|
||||||
929,
|
929,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user