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.4.35 < prev    next >
Encoding:
Internet Message Format  |  1999-08-17  |  3.8 KB

  1. To: vim-dev@vim.org
  2. Subject: patch 5.4.35
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. ------------
  6.  
  7. Patch 5.4.35
  8. Problem:    There is no function to get the current file size.
  9. Solution:   Allow using line2byte() with the number of lines in the file plus
  10.         one.  This returns the offset of the line past the end of the
  11.         file, which is the file size plus one.
  12. Files:        src/eval.c, runtime/doc/eval.txt
  13.  
  14.  
  15. *** ../vim-5.4.34/src/eval.c    Tue Aug 10 16:10:35 1999
  16. --- src/eval.c    Wed Aug 18 12:47:08 1999
  17. ***************
  18. *** 3358,3364 ****
  19.       linenr_t    lnum = 0;
  20.   
  21.       lnum = get_var_number(&argvars[0]);
  22. !     if (lnum < 1 || lnum > curbuf->b_ml.ml_line_count)
  23.       retvar->var_val.var_number = -1;
  24.       else
  25.       retvar->var_val.var_number = ml_find_line_or_offset(curbuf, lnum, NULL);
  26. --- 3360,3366 ----
  27.       linenr_t    lnum = 0;
  28.   
  29.       lnum = get_var_number(&argvars[0]);
  30. !     if (lnum < 1 || lnum > curbuf->b_ml.ml_line_count + 1)
  31.       retvar->var_val.var_number = -1;
  32.       else
  33.       retvar->var_val.var_number = ml_find_line_or_offset(curbuf, lnum, NULL);
  34. *** ../vim-5.4.34/runtime/doc/eval.txt    Wed Jul 21 22:43:32 1999
  35. --- runtime/doc/eval.txt    Wed Aug 18 13:01:02 1999
  36. ***************
  37. *** 597,602 ****
  38. --- 608,615 ----
  39.           for the current buffer.  The first character has byte count
  40.           one.
  41.           Also see |line2byte()|, |go| and |:goto|.
  42. +         {not available when compiled without the |+byte_offset|
  43. +         feature}
  44.   
  45.                               *char2nr()*
  46.   char2nr({expr})
  47. ***************
  48. *** 1001,1007 ****
  49.           Return the byte count from the start of the buffer for line
  50.           {lnum}.  This includes the end-of-line character, depending on
  51.           the 'fileformat' option for the current buffer.  The first
  52. !         line returns 1;
  53.           Also see |byte2line()|, |go| and |:goto|.
  54.   
  55.                               *localtime()*
  56. --- 1023,1035 ----
  57.           Return the byte count from the start of the buffer for line
  58.           {lnum}.  This includes the end-of-line character, depending on
  59.           the 'fileformat' option for the current buffer.  The first
  60. !         line returns 1.
  61. !         This can also be used to get the byte count for the line just
  62. !         below the last line:
  63. ! >            line2byte(line("$") + 1)
  64. !         This is the file size plus one.
  65. !         When {lnum} is invalid, or the |+byte_offset| feature has been
  66. !         disabled at compile time, -1 is returned.
  67.           Also see |byte2line()|, |go| and |:goto|.
  68.   
  69.                               *localtime()*
  70. *** ../vim-5.4.34/src/version.h    Wed Aug 18 12:53:26 1999
  71. --- src/version.h    Wed Aug 18 12:53:02 1999
  72. ***************
  73. *** 19,26 ****
  74.   #define VIM_VERSION_MINOR_STR        "4"
  75.   #define VIM_VERSION_BUILD         57
  76.   #define VIM_VERSION_BUILD_STR        "57"
  77. ! #define VIM_VERSION_PATCHLEVEL         34
  78. ! #define VIM_VERSION_PATCHLEVEL_STR    "34"
  79.   
  80.   /*
  81.    * VIM_VERSION_NODOT is used for the runtime directory name.
  82. --- 19,26 ----
  83.   #define VIM_VERSION_MINOR_STR        "4"
  84.   #define VIM_VERSION_BUILD         57
  85.   #define VIM_VERSION_BUILD_STR        "57"
  86. ! #define VIM_VERSION_PATCHLEVEL         35
  87. ! #define VIM_VERSION_PATCHLEVEL_STR    "35"
  88.   
  89.   /*
  90.    * VIM_VERSION_NODOT is used for the runtime directory name.
  91. ***************
  92. *** 30,35 ****
  93.    */
  94.   #define VIM_VERSION_NODOT    "vim54"
  95.   #define VIM_VERSION_SHORT    "5.4"
  96. ! #define VIM_VERSION_MEDIUM    "5.4.34"
  97. ! #define VIM_VERSION_LONG    "VIM - Vi IMproved 5.4.34 (1999 Aug 18)"
  98. ! #define VIM_VERSION_LONG_DATE    "VIM - Vi IMproved 5.4.34 (1999 Aug 18, compiled "
  99. --- 30,35 ----
  100.    */
  101.   #define VIM_VERSION_NODOT    "vim54"
  102.   #define VIM_VERSION_SHORT    "5.4"
  103. ! #define VIM_VERSION_MEDIUM    "5.4.35"
  104. ! #define VIM_VERSION_LONG    "VIM - Vi IMproved 5.4.35 (1999 Aug 18)"
  105. ! #define VIM_VERSION_LONG_DATE    "VIM - Vi IMproved 5.4.35 (1999 Aug 18, compiled "
  106.  
  107. --
  108. hundred-and-one symptoms of being an internet addict:
  109. 129. You cancel your newspaper subscription.
  110.  
  111. --/-/---- Bram Moolenaar ---- Bram@moolenaar.net ---- Bram@vim.org ---\-\--
  112.   \ \    www.vim.org/iccf      www.moolenaar.net       www.vim.org    / /
  113.