aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/edit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/edit.c')
-rw-r--r--src/nvim/edit.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index e6d9dcf092..1814e9d3d4 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -667,8 +667,9 @@ static int insert_execute(VimState *state, int key)
// there is nothing to add, CTRL-L works like CTRL-P then.
if (s->c == Ctrl_L
&& (!CTRL_X_MODE_LINE_OR_EVAL(ctrl_x_mode)
- || (int)STRLEN(compl_shown_match->cp_str)
- > curwin->w_cursor.col - compl_col)) {
+ || (compl_shown_match->cp_str != NULL
+ && (int)STRLEN(compl_shown_match->cp_str)
+ > curwin->w_cursor.col - compl_col))) {
ins_compl_addfrommatch();
return 1; // continue
}