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.5.036 < prev    next >
Encoding:
Internet Message Format  |  1999-10-30  |  3.5 KB

  1. To: vim-dev@vim.org
  2. Subject: patch 5.5.036
  3. Fcc: outbox
  4. From: Bram Moolenaar <Bram@moolenaar.net>
  5. ------------
  6.  
  7. Patch 5.5.036
  8. Problem:    The GZIP_read() function in $VIMRUNTIME/vimrc_example.vim to
  9.         uncompress a file did not do detection for 'fileformat'.  This is
  10.         because the filtering is done with 'binary' set.
  11. Solution:   Split the filtering into separate write, filter and read commands.
  12. Files:        runtime/vimrc_example.vim
  13.  
  14.  
  15. *** ../vim-5.5.35/runtime/vimrc_example.vim    Wed Sep 22 10:06:46 1999
  16. --- runtime/vimrc_example.vim    Wed Oct 27 10:49:28 1999
  17. ***************
  18. *** 1,14 ****
  19.   " An example for a vimrc file.
  20.   "
  21.   " Maintainer:    Bram Moolenaar <Bram@vim.org>
  22. ! " Last change:    1999 Sep 09
  23.   "
  24.   " To use it, copy it to
  25.   "     for Unix and OS/2:  ~/.vimrc
  26.   "             for Amiga:  s:.vimrc
  27.   "  for MS-DOS and Win32:  $VIM\_vimrc
  28.   
  29. ! set nocompatible    " Use Vim defaults (much better!)
  30.   set bs=2        " allow backspacing over everything in insert mode
  31.   set ai            " always set autoindenting on
  32.   set backup        " keep a backup file
  33. --- 1,17 ----
  34.   " An example for a vimrc file.
  35.   "
  36.   " Maintainer:    Bram Moolenaar <Bram@vim.org>
  37. ! " Last change:    1999 Oct 27
  38.   "
  39.   " To use it, copy it to
  40.   "     for Unix and OS/2:  ~/.vimrc
  41.   "             for Amiga:  s:.vimrc
  42.   "  for MS-DOS and Win32:  $VIM\_vimrc
  43.   
  44. ! " Use Vim settings, rather then Vi settings (much better!).
  45. ! " This must be first, because it changes other options as a side effect.
  46. ! set nocompatible
  47.   set bs=2        " allow backspacing over everything in insert mode
  48.   set ai            " always set autoindenting on
  49.   set backup        " keep a backup file
  50. ***************
  51. *** 69,80 ****
  52.   
  53.     " After reading compressed file: Uncompress text in buffer with "cmd"
  54.     fun! GZIP_read(cmd)
  55.       let ch_save = &ch
  56. !     set ch=2
  57. !     execute "'[,']!" . a:cmd
  58.       set nobin
  59.       let &ch = ch_save
  60. !     execute ":doautocmd BufReadPost " . expand("%:r")
  61.     endfun
  62.   
  63.     " After writing compressed file: Compress written file with "cmd"
  64. --- 72,103 ----
  65.   
  66.     " After reading compressed file: Uncompress text in buffer with "cmd"
  67.     fun! GZIP_read(cmd)
  68. +     " set 'cmdheight' to two, to avoid the hit-return prompt
  69.       let ch_save = &ch
  70. !     set ch=3
  71. !     " when filtering the whole buffer, it will become empty
  72. !     let empty = line("'[") == 1 && line("']") == line("$")
  73. !     let tmp = tempname()
  74. !     let tmpe = tmp . "." . expand("<afile>:e")
  75. !     " write the just read lines to a temp file "'[,']w tmp.gz"
  76. !     execute "'[,']w " . tmpe
  77. !     " uncompress the temp file "!gunzip tmp.gz"
  78. !     execute "!" . a:cmd . " " . tmpe
  79. !     " delete the compressed lines
  80. !     '[,']d
  81. !     " read in the uncompressed lines "'[-1r tmp"
  82.       set nobin
  83. +     execute "'[-1r " . tmp
  84. +     " if buffer became empty, delete trailing blank line
  85. +     if empty
  86. +       normal Gdd''
  87. +     endif
  88. +     " delete the temp file
  89. +     call delete(tmp)
  90.       let &ch = ch_save
  91. !     " When uncompressed the whole buffer, do autocommands
  92. !     if empty
  93. !       execute ":doautocmd BufReadPost " . expand("%:r")
  94.     endfun
  95.   
  96.     " After writing compressed file: Compress written file with "cmd"
  97. *** ../vim-5.5.35/src/version.c    Sun Oct 31 15:20:13 1999
  98. --- src/version.c    Sun Oct 31 15:28:25 1999
  99. ***************
  100. *** 420,420 ****
  101. --- 420,421 ----
  102.   {   /* Add new patch number below this line */
  103. +     36,
  104.  
  105. --
  106. hundred-and-one symptoms of being an internet addict:
  107. 33. You name your children Eudora, Mozilla and Dotcom.
  108.  
  109. --/-/---- Bram Moolenaar ---- Bram@moolenaar.net ---- Bram@vim.org ---\-\--
  110.   \ \    www.vim.org/iccf      www.moolenaar.net       www.vim.org    / /
  111.