On Nov 4 2007, 10:02 am, Bram Moolenaar <[email protected]> wrote: > Jjgod Jiang wrote: > > I seemed to have an issue running the bundled vim (/usr/bin/vim), for > > example: > > > $ /usr/bin/vim > > ... > > :w foo.txt > > :q > > > $ echo $? > > 1 > > > But if I use vim built by myself: > > > $ /Applications/Vim.app/Contents/MacOS/Vim > > ... > > :w bar.txt > > :q > > > $ echo $? > > 0 > > > This will cause a problem when I use EDITOR=vim for most VCS, > > because they use exit code of editor to determinate whether a commit > > message is successfully written. > > > Do some one else occur to have the same problem? > > Vim returns a non-zero exit code when there was any error while editing. > This is because of Posix compatibility. However, this should only > happen when in Ex mode, thus using "vim -e" or after "Q". It's unclear > why it would happen when starting vim and using ":q" from Normal mode. > I can't reproduce it.
This happens to me on 10.5.6 (vim 7.2.22). Running "vim", searching for a non-existent string "/asdf<CR>", then quitting ":q<CR>" will produce an exit code of 1. For some reason this only happens when I run "vim", and not "/usr/bin/ vim". Here's a shell log of me doing the above steps with the two different process names: octopus:~ jrray$ vim || echo failed failed octopus:~ jrray$ /usr/bin/vim || echo failed octopus:~ jrray$ which vim /usr/bin/vim This continues to happen after I move my ~/.vim dir and ~/.vimrc file out of the way. --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_mac" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
