Skip to content

Commit 3bab939

Browse files
committed
patch 8.0.0546: swap file exists briefly when opening the command window
Problem: Swap file exists briefly when opening the command window. Solution: Set the noswapfile command modifier before splitting the window. (James McCoy, closes #1620)
1 parent 15ecbd6 commit 3bab939

3 files changed

Lines changed: 8 additions & 6 deletions

File tree

src/ex_getln.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ static void clear_hist_entry(histentry_T *hisptr);
127127
#endif
128128

129129
#ifdef FEAT_CMDWIN
130-
static int ex_window(void);
130+
static int open_cmdwin(void);
131131
#endif
132132

133133
#if defined(FEAT_CMDL_COMPL) || defined(PROTO)
@@ -773,7 +773,7 @@ getcmdline(
773773
/*
774774
* Open a window to edit the command line (and history).
775775
*/
776-
c = ex_window();
776+
c = open_cmdwin();
777777
some_key_typed = TRUE;
778778
}
779779
}
@@ -1292,7 +1292,7 @@ getcmdline(
12921292
goto cmdline_not_changed;
12931293

12941294
case K_IGNORE:
1295-
/* Ignore mouse event or ex_window() result. */
1295+
/* Ignore mouse event or open_cmdwin() result. */
12961296
goto cmdline_not_changed;
12971297

12981298
#ifdef FEAT_GUI_W32
@@ -6796,7 +6796,7 @@ cmd_gchar(int offset)
67966796
* K_IGNORE if editing continues
67976797
*/
67986798
static int
6799-
ex_window(void)
6799+
open_cmdwin(void)
68006800
{
68016801
struct cmdline_info save_ccline;
68026802
bufref_T old_curbuf;
@@ -6841,6 +6841,7 @@ ex_window(void)
68416841
# endif
68426842
/* don't use a new tab page */
68436843
cmdmod.tab = 0;
6844+
cmdmod.noswapfile = 1;
68446845

68456846
/* Create a window for the command-line buffer. */
68466847
if (win_split((int)p_cwh, WSP_BOT) == FAIL)
@@ -6857,7 +6858,6 @@ ex_window(void)
68576858
(void)do_ecmd(0, NULL, NULL, NULL, ECMD_ONE, ECMD_HIDE, NULL);
68586859
(void)setfname(curbuf, (char_u *)"[Command Line]", NULL, TRUE);
68596860
set_option_value((char_u *)"bt", 0L, (char_u *)"nofile", OPT_LOCAL);
6860-
set_option_value((char_u *)"swf", 0L, NULL, OPT_LOCAL);
68616861
curbuf->b_p_ma = TRUE;
68626862
#ifdef FEAT_FOLDING
68636863
curwin->w_p_fen = FALSE;

src/option.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11058,7 +11058,7 @@ buf_copy_options(buf_T *buf, int flags)
1105811058
buf->b_p_ml = p_ml;
1105911059
buf->b_p_ml_nobin = p_ml_nobin;
1106011060
buf->b_p_inf = p_inf;
11061-
buf->b_p_swf = p_swf;
11061+
buf->b_p_swf = cmdmod.noswapfile ? FALSE : p_swf;
1106211062
#ifdef FEAT_INS_EXPAND
1106311063
buf->b_p_cpt = vim_strsave(p_cpt);
1106411064
#endif

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,8 @@ static char *(features[]) =
764764

765765
static int included_patches[] =
766766
{ /* Add new patch number below this line */
767+
/**/
768+
546,
767769
/**/
768770
545,
769771
/**/

0 commit comments

Comments
 (0)