To: vim_dev@googlegroups.com Subject: Patch 7.4.2115 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 7.4.2115 Problem: Loading defaults.vim with -C argument. Solution: Don't load the defaults script with -C argument. Test sourcing the defaults script. Set 'display' to "truncate". Files: src/main.c, src/Makefile, runtime/defaults.vim, src/testdir/test_startup.vim, src/testdir/Make_all.mak *** ../vim-7.4.2114/src/main.c 2016-07-28 22:22:39.978236440 +0200 --- src/main.c 2016-07-29 18:03:42.925676357 +0200 *************** *** 90,95 **** --- 90,97 ---- static char_u *start_dir = NULL; /* current working dir on startup */ + static int has_dash_c_arg = FALSE; + int # ifdef VIMDLL _export *************** *** 1928,1933 **** --- 1930,1936 ---- case 'C': /* "-C" Compatible */ change_compatible(TRUE); + has_dash_c_arg = TRUE; break; case 'e': /* "-e" Ex mode */ *************** *** 3001,3007 **** #ifdef USR_EXRC_FILE2 && do_source((char_u *)USR_EXRC_FILE2, FALSE, DOSO_NONE) == FAIL #endif ! ) { /* When no .vimrc file was found: source defaults.vim. */ do_source((char_u *)VIM_DEFAULTS_FILE, FALSE, DOSO_NONE); --- 3004,3010 ---- #ifdef USR_EXRC_FILE2 && do_source((char_u *)USR_EXRC_FILE2, FALSE, DOSO_NONE) == FAIL #endif ! && !has_dash_c_arg) { /* When no .vimrc file was found: source defaults.vim. */ do_source((char_u *)VIM_DEFAULTS_FILE, FALSE, DOSO_NONE); *** ../vim-7.4.2114/src/Makefile 2016-07-29 16:15:13.038677979 +0200 --- src/Makefile 2016-07-29 18:08:30.982973465 +0200 *************** *** 2107,2112 **** --- 2107,2113 ---- test_regexp_utf8 \ test_reltime \ test_ruby \ + test_startup \ test_searchpos \ test_set \ test_sort \ *** ../vim-7.4.2114/runtime/defaults.vim 2016-07-28 22:22:39.982236402 +0200 --- runtime/defaults.vim 2016-07-29 18:10:01.370125305 +0200 *************** *** 1,7 **** " The default vimrc file. " " Maintainer: Bram Moolenaar ! " Last change: 2016 Jul 28 " " This is loaded if no vimrc file was found. " Except when Vim is run with "-u NONE" or "-C". --- 1,7 ---- " The default vimrc file. " " Maintainer: Bram Moolenaar ! " Last change: 2016 Jul 29 " " This is loaded if no vimrc file was found. " Except when Vim is run with "-u NONE" or "-C". *************** *** 25,30 **** --- 25,33 ---- set showcmd " display incomplete commands set wildmenu " display completion matches in a status line + " Show @@@ in the last line if it is truncated. + set display=truncate + " Do incremental searching when it's possible to timeout. if has('reltime') set incsearch *** ../vim-7.4.2114/src/testdir/test_startup.vim 2016-07-29 18:12:56.652480468 +0200 --- src/testdir/test_startup.vim 2016-07-29 18:08:00.031263900 +0200 *************** *** 0 **** --- 1,8 ---- + " Check that loading startup.vim works. + + func Test_startup_script() + set compatible + source $VIMRUNTIME/defaults.vim + + call assert_equal(0, &compatible) + endfunc *** ../vim-7.4.2114/src/testdir/Make_all.mak 2016-07-29 16:15:13.038677979 +0200 --- src/testdir/Make_all.mak 2016-07-29 18:08:20.607070828 +0200 *************** *** 184,189 **** --- 184,190 ---- test_perl.res \ test_quickfix.res \ test_ruby.res \ + test_startup.res \ test_stat.res \ test_syntax.res \ test_textobjects.res \ *** ../vim-7.4.2114/src/version.c 2016-07-29 17:03:48.863345220 +0200 --- src/version.c 2016-07-29 18:08:58.106718948 +0200 *************** *** 760,761 **** --- 760,763 ---- { /* Add new patch number below this line */ + /**/ + 2115, /**/ -- It is illegal to rob a bank and then shoot at the bank teller with a water pistol. [real standing law in Louisana, United States of America] /// Bram Moolenaar -- Bram@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 ///