murisfurder / vim

Automatically exported from code.google.com/p/vim
0 stars 0 forks source link

After initial failure, then eventual success, Vim still exits with EXIT_FAILURE #186

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Greetings, lovely people!

I *believe* I've found a bug, although I could be wrong:

> What steps will reproduce the problem?

$ vi test
:wq
$ echo $?
0

I correctly get an exit status of EXIT_SUCCESS.

$ vi test
:Wq
:wq
$ echo $?
1

I get an exit status of EXIT_FAILURE.  I realise that it's clearly my own 
trigger happy fault to typo :Wq, which correctly gives me an error message.  
However, subsequently correctly typing :wq and therefore successfully saving 
the file should surely override this, counting as a successful exit?

This would help me no end as, I believe, it would stop Git then throwing away 
the file -- the commit message -- with an error message, believing it to be 
faulty.

> What is the expected output? What do you see instead?

I'd expect a 0 (EXIT_SUCCESS) if the write-and-quit command :wq was successful 
upon leaving the problem, even if I made a typo typing in a command earlier on.

Instead, I see a 1 (EXIT_FAILURE).

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

I'm using Vim on Apple's OS X Mavericks, as it's supplied out of the box.  This 
is:

VIM - Vi IMproved 7.3 (2010 Aug 15, compiled Aug 24 2013 18:58:47)

> Please provide any additional information below.

Sorry I couldn't find out whether the issue is OS X specific or not.  My other 
computer is a Raspberry Pi, and happens to be running a different flavour of 
vi.  (For what it's worth, it appears to be vanilla vi "Version 4.0 (gritter) 
3/25/05", and it exits with EXIT_SUCCESS in both instances.)

Thank you very much for looking at this!

All the best,
Zoë.

(A big fan of both vi in general and Vim in particular.)

Original issue reported on code.google.com by z...@transistorsounds.com on 12 Dec 2013 at 4:48

GoogleCodeExporter commented 9 years ago
A few amendments:

Running "vim" is fine.  Running "vi" isn't.  This is curious, as "vi" is a link 
to "vim":

$ ls -l /usr/bin/vi
lrwxr-xr-x  1 root  wheel  3 30 Oct 21:28 /usr/bin/vi -> vi

I managed to find a Linux machine running Vim 7.2.445, and it's fine, even 
using "vi" as the command.  So it looks like the issue is indeed specific to OS 
X.

Original comment by z...@transistorsounds.com on 12 Dec 2013 at 5:10

GoogleCodeExporter commented 9 years ago
Sorry, that line should have read:

lrwxr-xr-x  1 root  wheel  3 30 Oct 21:28 /usr/bin/vi -> vim

Original comment by z...@transistorsounds.com on 12 Dec 2013 at 5:13