summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-04-07 15:42:25 +0200
committerBram Moolenaar <Bram@vim.org>2017-04-07 15:42:25 +0200
commit3bab93998d01a01b7f2a071fa3b8054bb0094625 (patch)
treebaa7c91b4ac194d42ae6c3e7213b2b993f4d03cc
parent15ecbd6f3d39ff04862999a577962ef9369a9e53 (diff)
downloadvim-git-3bab93998d01a01b7f2a071fa3b8054bb0094625.tar.gz
patch 8.0.0546: swap file exists briefly when opening the command windowv8.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)
-rw-r--r--src/ex_getln.c10
-rw-r--r--src/option.c2
-rw-r--r--src/version.c2
3 files changed, 8 insertions, 6 deletions
diff --git a/src/ex_getln.c b/src/ex_getln.c
index c706476b8..c42abe983 100644
--- a/src/ex_getln.c
+++ b/src/ex_getln.c
@@ -127,7 +127,7 @@ static void clear_hist_entry(histentry_T *hisptr);
#endif
#ifdef FEAT_CMDWIN
-static int ex_window(void);
+static int open_cmdwin(void);
#endif
#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
@@ -773,7 +773,7 @@ getcmdline(
/*
* Open a window to edit the command line (and history).
*/
- c = ex_window();
+ c = open_cmdwin();
some_key_typed = TRUE;
}
}
@@ -1292,7 +1292,7 @@ getcmdline(
goto cmdline_not_changed;
case K_IGNORE:
- /* Ignore mouse event or ex_window() result. */
+ /* Ignore mouse event or open_cmdwin() result. */
goto cmdline_not_changed;
#ifdef FEAT_GUI_W32
@@ -6796,7 +6796,7 @@ cmd_gchar(int offset)
* K_IGNORE if editing continues
*/
static int
-ex_window(void)
+open_cmdwin(void)
{
struct cmdline_info save_ccline;
bufref_T old_curbuf;
@@ -6841,6 +6841,7 @@ ex_window(void)
# 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,7 +6858,6 @@ ex_window(void)
(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;
diff --git a/src/option.c b/src/option.c
index c40454844..d4f72755d 100644
--- a/src/option.c
+++ b/src/option.c
@@ -11058,7 +11058,7 @@ buf_copy_options(buf_T *buf, int flags)
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;
+ buf->b_p_swf = cmdmod.noswapfile ? FALSE : p_swf;
#ifdef FEAT_INS_EXPAND
buf->b_p_cpt = vim_strsave(p_cpt);
#endif
diff --git a/src/version.c b/src/version.c
index 4d386eebc..8f50ac5a5 100644
--- a/src/version.c
+++ b/src/version.c
@@ -765,6 +765,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 546,
+/**/
545,
/**/
544,