Skip to content

Commit 942b454

Browse files
committed
patch 8.1.0064: typing CTRL-W in a prompt buffer shows mode "-- --"
Problem: Typing CTRL-W in a prompt buffer shows mode "-- --". Solution: Set restart_edit to 'A' and check for it.
1 parent d595a19 commit 942b454

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

src/edit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1179,7 +1179,7 @@ edit(
11791179
// In a prompt window CTRL-W is used for window commands.
11801180
// Use Shift-CTRL-W to delete a word.
11811181
stuffcharReadbuff(Ctrl_W);
1182-
restart_edit = 'i';
1182+
restart_edit = 'A';
11831183
nomove = TRUE;
11841184
count = 0;
11851185
goto doESCkey;

src/screen.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10263,7 +10263,7 @@ showmode(void)
1026310263

1026410264
do_mode = ((p_smd && msg_silent == 0)
1026510265
&& ((State & INSERT)
10266-
|| restart_edit
10266+
|| restart_edit != NUL
1026710267
|| VIsual_active));
1026810268
if (do_mode || reg_recording != 0)
1026910269
{
@@ -10370,7 +10370,7 @@ showmode(void)
1037010370
#endif
1037110371
MSG_PUTS_ATTR(_(" INSERT"), attr);
1037210372
}
10373-
else if (restart_edit == 'I')
10373+
else if (restart_edit == 'I' || restart_edit == 'A')
1037410374
MSG_PUTS_ATTR(_(" (insert)"), attr);
1037510375
else if (restart_edit == 'R')
1037610376
MSG_PUTS_ATTR(_(" (replace)"), attr);

src/version.c

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

762762
static int included_patches[] =
763763
{ /* Add new patch number below this line */
764+
/**/
765+
64,
764766
/**/
765767
63,
766768
/**/

src/window.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2114,6 +2114,8 @@ leaving_window(win_T *win)
21142114
// When leaving a prompt window stop Insert mode and perhaps restart
21152115
// it when entering that window again.
21162116
win->w_buffer->b_prompt_insert = restart_edit;
2117+
if (restart_edit != 0 && mode_displayed)
2118+
clear_cmdline = TRUE; /* unshow mode later */
21172119
restart_edit = NUL;
21182120

21192121
// When leaving the window (or closing the window) was done from a

0 commit comments

Comments
 (0)