Issue 276 in vim: opening file with .gz extension

2014-10-29 Fir de Conversatie vim

Status: New
Owner: 
Labels: Type-Defect Priority-Medium

New issue 276 by santosh@gmail.com: opening file with .gz extension
https://code.google.com/p/vim/issues/detail?id=276

The default behaviour of vim when opening a file with .gz extension, is  
to decompress and then re-compress it again when saving it. In a situation  
when the file has a  .gz extension, BUT IT IS NOT GZIPPED, vim gives  
error in the first part of decompression. But the 2nd part of  
re-compression goes ahead as it is, which has an unwanted side-effect that  
the original file gets compressed. Although not a bug, it would be better  
if the behaviour was more consistent and vim didn't try to re-compress the  
file if it was not able to decompress it originally.


What steps will reproduce the problem?
1. Create a file txt-file (no compression) with .gz extension
$ echo -e one\ntwo  vimtmp.gz

2. open the file with vim, it spits the following error msg:

--
vimtmp.gz 2L, 8C
Error detected while processing function gzip#read:
line   44:
Error: Could not read uncompressed file
Press ENTER or type command to continue
--

Press ENTER and continue to open the file.

3. Save the file using :wq
Here, vim doesn't give any warning or error and compresses the file using  
gzip.


What is the expected output? What do you see instead?
No compression of the original file, if vim encountered an error in  
decompression.


What version of the product are you using? On what operating system?

version 7.2.108 on Mac OS X (10.6.8)
version 7.3.49 on Ubuntu 12-04.4 LTS


Please provide any additional information below.
It seems to be more generic issue related to how vim gzip plugin  
handles .gz file, and can be potentially affecting all versions (on all  
OSes)



--
You received this message because this project is configured to send all  
issue notifications to this address.

You may adjust your notification preferences at:
https://code.google.com/hosting/settings

--
--
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.


Re: [patch] Use a [count] for do/dp as the [bufspec] for :diffget/:diffput

2014-10-29 Fir de Conversatie James McCoy
On Oct 29, 2014 12:45 AM, Dominique Pellé dominique.pe...@gmail.com
wrote:

 James McCoy wrote:

  Needing to fallback to :diffget/:diffput instead of do/dp when dealing
  with a 3-way diff has always bothered me.  I've been having to do that
  more lately, so the attached patch turns a supplied [count] for do/dp
  into the [bufspec] for :diffget/:diffput.
 
  Obviously, it's not as expressive as being able to use the full bufspec,
  but, at least for me, I always know the buffer number, so providing the
  count is much quicker.

 Hi James

 Your patch looks useful.

 But you wrote 3-way diff and in my opinion, Vim diff does not
 do 3-way diff.  Vim can diff 3 files against each other, but that
 does not qualify as a 3-way diff.

Sure, but that's beside the point of my email.  I agree that Vim doesn't
present a3-way diff as nicely as other tools, but it's good enough for what
I've been needing to do lately (along with some scripting of diff3).

Cheers,
James

-- 
-- 
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.


Re: allow to vimgrep current buffer

2014-10-29 Fir de Conversatie Bram Moolenaar

Christian wrote:

 On Di, 28 Okt 2014, Ingo Karkat wrote:
  Well, then perhaps a separate :bvimgrep[add] set of commands would be
  better than overloading the existing commands:
  
  :bvimgrep[!] /{pattern}/[g][j] [bufname]
  :N,Mbvimgrep[!] /{pattern}/[g][j]
  :bvimgrep[!] /{pattern}/[g][j] N1 N2 ...
 
 Sounds useful. Bram, would you consider including this feature, if I
 write a patch for that?

I think it can be done with a bit of Vim script, but it might be
generally useful, thus nice to work without installing a plugin.

It could also be a solution for something that doesn't work yet: Search
within a Visual block.  Since this is going to be a new command, we can
make :',' respect the Visual mode, including block.  So you could
select a block and type :bvimgrep /pattern/, then move to matches with
:cn.

I think we can actually call it :bgrep.  It's very unlikely 'grepprg'
is useful to search in buffers and it's shorter to type.

-- 
PRINCE:He's come to rescue me, father.
LAUNCELOT: (embarrassed) Well, let's not jump to conclusions ...
 Monty Python and the Holy Grail PYTHON (MONTY) PICTURES LTD

 /// 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.


Re: Documentation patch: :global [cmd] can have a range

2014-10-29 Fir de Conversatie Bram Moolenaar

Michael Henry wrote:

 Here is a small documentation patch that indicates the [cmd]
 associated with the :global command may contain a range.  Tim
 Chase pointed out a couple of pre-existing examples in the
 documentation, so I've linked to them from :global, which required
 adding one extra tag in usr_25.txt.

Thanks for the suggestion.  I'll include it.


-- 
A vacation is a period of travel during which you find that you
took twice as many clothes and half as much money as you needed.

 /// 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.