home *** CD-ROM | disk | FTP | other *** search
/ vim.ftp.fu-berlin.de / 2015-02-03.vim.ftp.fu-berlin.de.tar / vim.ftp.fu-berlin.de / patches / old / 5.6.010 < prev    next >
Encoding:
Internet Message Format  |  2000-01-25  |  3.2 KB

  1. To: vim-dev@vim.org
  2. Subject: Patch 5.6.010
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. ------------
  6.  
  7. Patch 5.6.010
  8. Problem:    A file name which contains a TAB was not read correctly from the
  9.         viminfo file and the ":ls" listing was not aligned properly.
  10. Solution:   Parse the buffer list lines in the viminfo file from the end
  11.         backwards.  Count a Tab for two characters to align the ":ls" list.
  12. Files:        src/buffer.c
  13.  
  14.  
  15. *** ../vim-5.6.9/src/buffer.c    Wed Dec 15 13:54:07 1999
  16. --- src/buffer.c    Wed Jan 26 10:34:43 2000
  17. ***************
  18. *** 1461,1466 ****
  19. --- 1461,1467 ----
  20.   {
  21.       BUF        *buf;
  22.       int        len;
  23. +     int        i;
  24.   
  25.       for (buf = firstbuf; buf != NULL && !got_int; buf = buf->b_next)
  26.       {
  27. ***************
  28. *** 1483,1495 ****
  29.   
  30.       len = STRLEN(IObuff);
  31.       IObuff[len++] = '"';
  32. !     /*
  33. !      * try to put the "line" strings in column 40
  34. !      */
  35.       do
  36.       {
  37.           IObuff[len++] = ' ';
  38. !     } while (len < 40 && len < IOSIZE - 18);
  39.       sprintf((char *)IObuff + len, "line %ld",
  40.           buf == curbuf ? curwin->w_cursor.lnum :
  41.                   (long)buflist_findlnum(buf));
  42. --- 1484,1497 ----
  43.   
  44.       len = STRLEN(IObuff);
  45.       IObuff[len++] = '"';
  46. !     /* put "line 999" in column 40 or after the file name */
  47. !     IObuff[len] = NUL;
  48. !     i = 40 - vim_strsize(IObuff);
  49.       do
  50.       {
  51.           IObuff[len++] = ' ';
  52. !     } while (--i > 0 && len < IOSIZE - 18);
  53.       sprintf((char *)IObuff + len, "line %ld",
  54.           buf == curbuf ? curwin->w_cursor.lnum :
  55.                   (long)buflist_findlnum(buf));
  56. ***************
  57. *** 2610,2625 ****
  58.       /* don't read in if there are files on the command-line or if writing: */
  59.       if (!writing && arg_file_count == 0 && find_viminfo_parameter('%') != NULL)
  60.       {
  61. !     tab = vim_strchr(line + 1, '\t');
  62.       lnum = 0;
  63.       col = 0;
  64.       if (tab != NULL)
  65.       {
  66.           *tab++ = '\0';
  67. !         lnum = atol((char *)tab);
  68. !         tab = vim_strchr(tab, '\t');
  69.           if (tab != NULL)
  70. !         col = atoi((char *)tab + 1);
  71.       }
  72.   
  73.       /* Expand "~/" in the file name at "line + 1" to a full path.
  74. --- 2612,2632 ----
  75.       /* don't read in if there are files on the command-line or if writing: */
  76.       if (!writing && arg_file_count == 0 && find_viminfo_parameter('%') != NULL)
  77.       {
  78. !     /* Format is: <fname> Tab <lnum> Tab <col>.
  79. !      * Watch out for a Tab in the file name, work from the end. */
  80.       lnum = 0;
  81.       col = 0;
  82. +     tab = vim_strrchr(line + 1, '\t');
  83.       if (tab != NULL)
  84.       {
  85.           *tab++ = '\0';
  86. !         col = atoi((char *)tab);
  87. !         tab = vim_strrchr(line + 1, '\t');
  88.           if (tab != NULL)
  89. !         {
  90. !         *tab++ = '\0';
  91. !         lnum = atol((char *)tab);
  92. !         }
  93.       }
  94.   
  95.       /* Expand "~/" in the file name at "line + 1" to a full path.
  96. *** ../vim-5.6.9/src/version.c    Wed Jan 26 10:39:47 2000
  97. --- src/version.c    Wed Jan 26 10:38:53 2000
  98. ***************
  99. *** 420,421 ****
  100. --- 420,423 ----
  101.   {   /* Add new patch number below this line */
  102. + /**/
  103. +     10,
  104.   /**/
  105.  
  106. -- 
  107. ARTHUR:  I am your king!
  108. WOMAN:   Well, I didn't vote for you.
  109. ARTHUR:  You don't vote for kings.
  110. WOMAN:   Well, 'ow did you become king then?
  111.                                   The Quest for the Holy Grail (Monty Python)
  112.  
  113. /-/-- Bram Moolenaar --- Bram@moolenaar.net --- http://www.moolenaar.net --\-\
  114. \ \   Vim: http://www.vim.org      ICCF Holland: http://www.vim.org/iccf   / /
  115.