summaryrefslogtreecommitdiffstats
path: root/src/edit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/edit.c')
-rw-r--r--src/edit.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/edit.c b/src/edit.c
index 2f81b52dff..452d4a6dc7 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -4109,11 +4109,11 @@ ins_compl_fixRedoBufForLeader(char_u *ptr_arg)
static buf_T *
ins_compl_next_buf(buf_T *buf, int flag)
{
- static win_T *wp;
+ static win_T *wp = NULL;
- if (flag == 'w') /* just windows */
+ if (flag == 'w') // just windows
{
- if (buf == curbuf) /* first call for this flag/expansion */
+ if (buf == curbuf || wp == NULL) // first call for this flag/expansion
wp = curwin;
while ((wp = (wp->w_next != NULL ? wp->w_next : firstwin)) != curwin
&& wp->w_buffer->b_scanned)