mirror of
https://github.com/vim/vim.git
synced 2025-07-26 11:04:33 -04:00
patch 8.0.0039
Problem: When Vim 8 reads an old viminfo and exits, the next time marks are not read from viminfo. (Ned Batchelder) Solution: Set a mark when it wasn't set before, even when the timestamp is zero. (closes #1170)
This commit is contained in:
parent
ca291aec99
commit
156919f99a
@ -1597,7 +1597,8 @@ handle_viminfo_mark(garray_T *values, int force)
|
|||||||
|
|
||||||
if (fm != NULL)
|
if (fm != NULL)
|
||||||
{
|
{
|
||||||
if (vi_namedfm != NULL || fm->time_set < timestamp || force)
|
if (vi_namedfm != NULL || fm->fmark.mark.lnum == 0
|
||||||
|
|| fm->time_set < timestamp || force)
|
||||||
{
|
{
|
||||||
fm->fmark.mark.lnum = lnum;
|
fm->fmark.mark.lnum = lnum;
|
||||||
fm->fmark.mark.col = col;
|
fm->fmark.mark.col = col;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
" Test for reading and writing .viminfo
|
" Test for reading and writing .viminfo
|
||||||
|
|
||||||
function Test_read_and_write()
|
function Test_viminfo_read_and_write()
|
||||||
call histdel(':')
|
call histdel(':')
|
||||||
let lines = [
|
let lines = [
|
||||||
\ '# comment line',
|
\ '# comment line',
|
||||||
@ -17,7 +17,7 @@ function Test_read_and_write()
|
|||||||
let lines = readfile('Xviminfo')
|
let lines = readfile('Xviminfo')
|
||||||
let done = 0
|
let done = 0
|
||||||
for line in lines
|
for line in lines
|
||||||
if line[0] == '|' && line !~ '^|[234],'
|
if line[0] == '|' && line !~ '^|[234],' && line !~ '^|<'
|
||||||
if done == 0
|
if done == 0
|
||||||
call assert_equal('|1,4', line)
|
call assert_equal('|1,4', line)
|
||||||
elseif done == 1
|
elseif done == 1
|
||||||
@ -469,7 +469,27 @@ func Test_viminfo_file_mark_tabclose()
|
|||||||
silent! bwipe Xtestfileintab
|
silent! bwipe Xtestfileintab
|
||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
func Test_oldfiles()
|
func Test_viminfo_file_mark_zero_time()
|
||||||
|
let lines = [
|
||||||
|
\ '# Viminfo version',
|
||||||
|
\ '|1,4',
|
||||||
|
\ '',
|
||||||
|
\ '*encoding=utf-8',
|
||||||
|
\ '',
|
||||||
|
\ '# File marks:',
|
||||||
|
\ "'B 1 0 /tmp/nothing",
|
||||||
|
\ '|4,66,1,0,0,"/tmp/nothing"',
|
||||||
|
\ "",
|
||||||
|
\ ]
|
||||||
|
call writefile(lines, 'Xviminfo')
|
||||||
|
delmark B
|
||||||
|
rviminfo Xviminfo
|
||||||
|
call delete('Xviminfo')
|
||||||
|
call assert_equal(1, line("'B"))
|
||||||
|
delmark B
|
||||||
|
endfunc
|
||||||
|
|
||||||
|
func Test_viminfo_oldfiles()
|
||||||
let v:oldfiles = []
|
let v:oldfiles = []
|
||||||
let lines = [
|
let lines = [
|
||||||
\ '# comment line',
|
\ '# comment line',
|
||||||
|
@ -764,6 +764,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 */
|
||||||
|
/**/
|
||||||
|
39,
|
||||||
/**/
|
/**/
|
||||||
38,
|
38,
|
||||||
/**/
|
/**/
|
||||||
|
Loading…
x
Reference in New Issue
Block a user