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)
Files:      src/mark.c, src/testdir/test_viminfo.vim


*** ../vim-8.0.0038/src/mark.c  2016-08-29 22:42:20.000000000 +0200
--- src/mark.c  2016-10-15 20:42:31.522292708 +0200
***************
*** 1597,1603 ****
  
      if (fm != NULL)
      {
!       if (vi_namedfm != NULL || fm->time_set < timestamp || force)
        {
            fm->fmark.mark.lnum = lnum;
            fm->fmark.mark.col = col;
--- 1597,1604 ----
  
      if (fm != NULL)
      {
!       if (vi_namedfm != NULL || fm->fmark.mark.lnum == 0
!                                         || fm->time_set < timestamp || force)
        {
            fm->fmark.mark.lnum = lnum;
            fm->fmark.mark.col = col;
*** ../vim-8.0.0038/src/testdir/test_viminfo.vim        2016-08-26 
20:35:50.000000000 +0200
--- src/testdir/test_viminfo.vim        2016-10-15 20:38:48.599935714 +0200
***************
*** 1,6 ****
  " Test for reading and writing .viminfo
  
! function Test_read_and_write()
    call histdel(':')
    let lines = [
        \ '# comment line',
--- 1,6 ----
  " Test for reading and writing .viminfo
  
! function Test_viminfo_read_and_write()
    call histdel(':')
    let lines = [
        \ '# comment line',
***************
*** 17,23 ****
    let lines = readfile('Xviminfo')
    let done = 0
    for line in lines
!     if line[0] == '|' && line !~ '^|[234],'
        if done == 0
        call assert_equal('|1,4', line)
        elseif done == 1
--- 17,23 ----
    let lines = readfile('Xviminfo')
    let done = 0
    for line in lines
!     if line[0] == '|' && line !~ '^|[234],' && line !~ '^|<'
        if done == 0
        call assert_equal('|1,4', line)
        elseif done == 1
***************
*** 469,475 ****
    silent! bwipe Xtestfileintab
  endfunc
  
! func Test_oldfiles()
    let v:oldfiles = []
    let lines = [
        \ '# comment line',
--- 469,495 ----
    silent! bwipe Xtestfileintab
  endfunc
  
! 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 lines = [
        \ '# comment line',
*** ../vim-8.0.0038/src/version.c       2016-10-15 19:33:47.264689748 +0200
--- src/version.c       2016-10-15 20:41:39.246677996 +0200
***************
*** 766,767 ****
--- 766,769 ----
  {   /* Add new patch number below this line */
+ /**/
+     39,
  /**/

-- 
If an elephant is left tied to a parking meter, the parking fee has to be paid
just as it would for a vehicle.
                [real standing law in Florida, United States of America]

 /// Bram Moolenaar -- b...@moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to vim_dev+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui