To: vim_dev@googlegroups.com Subject: Patch 8.0.0546 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.0546 Problem: Swap file exists briefly when opening the command window. Solution: Set the noswapfile command modifier before splitting the window. (James McCoy, closes #1620) Files: src/ex_getln.c, src/option.c *** ../vim-8.0.0545/src/ex_getln.c 2017-03-30 22:04:50.889883100 +0200 --- src/ex_getln.c 2017-04-07 14:59:33.606405002 +0200 *************** *** 127,133 **** #endif #ifdef FEAT_CMDWIN ! static int ex_window(void); #endif #if defined(FEAT_CMDL_COMPL) || defined(PROTO) --- 127,133 ---- #endif #ifdef FEAT_CMDWIN ! static int open_cmdwin(void); #endif #if defined(FEAT_CMDL_COMPL) || defined(PROTO) *************** *** 773,779 **** /* * Open a window to edit the command line (and history). */ ! c = ex_window(); some_key_typed = TRUE; } } --- 773,779 ---- /* * Open a window to edit the command line (and history). */ ! c = open_cmdwin(); some_key_typed = TRUE; } } *************** *** 1292,1298 **** goto cmdline_not_changed; case K_IGNORE: ! /* Ignore mouse event or ex_window() result. */ goto cmdline_not_changed; #ifdef FEAT_GUI_W32 --- 1292,1298 ---- goto cmdline_not_changed; case K_IGNORE: ! /* Ignore mouse event or open_cmdwin() result. */ goto cmdline_not_changed; #ifdef FEAT_GUI_W32 *************** *** 6796,6802 **** * K_IGNORE if editing continues */ static int ! ex_window(void) { struct cmdline_info save_ccline; bufref_T old_curbuf; --- 6796,6802 ---- * K_IGNORE if editing continues */ static int ! open_cmdwin(void) { struct cmdline_info save_ccline; bufref_T old_curbuf; *************** *** 6841,6846 **** --- 6841,6847 ---- # endif /* don't use a new tab page */ cmdmod.tab = 0; + cmdmod.noswapfile = 1; /* Create a window for the command-line buffer. */ if (win_split((int)p_cwh, WSP_BOT) == FAIL) *************** *** 6857,6863 **** (void)do_ecmd(0, NULL, NULL, NULL, ECMD_ONE, ECMD_HIDE, NULL); (void)setfname(curbuf, (char_u *)"[Command Line]", NULL, TRUE); set_option_value((char_u *)"bt", 0L, (char_u *)"nofile", OPT_LOCAL); - set_option_value((char_u *)"swf", 0L, NULL, OPT_LOCAL); curbuf->b_p_ma = TRUE; #ifdef FEAT_FOLDING curwin->w_p_fen = FALSE; --- 6858,6863 ---- *** ../vim-8.0.0545/src/option.c 2017-03-16 17:23:26.831815811 +0100 --- src/option.c 2017-04-07 14:56:08.223691304 +0200 *************** *** 11058,11064 **** buf->b_p_ml = p_ml; buf->b_p_ml_nobin = p_ml_nobin; buf->b_p_inf = p_inf; ! buf->b_p_swf = p_swf; #ifdef FEAT_INS_EXPAND buf->b_p_cpt = vim_strsave(p_cpt); #endif --- 11058,11064 ---- buf->b_p_ml = p_ml; buf->b_p_ml_nobin = p_ml_nobin; buf->b_p_inf = p_inf; ! buf->b_p_swf = cmdmod.noswapfile ? FALSE : p_swf; #ifdef FEAT_INS_EXPAND buf->b_p_cpt = vim_strsave(p_cpt); #endif *** ../vim-8.0.0545/src/version.c 2017-04-07 14:10:44.856821123 +0200 --- src/version.c 2017-04-07 14:58:12.142915160 +0200 *************** *** 766,767 **** --- 766,769 ---- { /* Add new patch number below this line */ + /**/ + 546, /**/ -- The software said it requires Windows 95 or better, so I installed Linux. /// 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 ///