From d1b2a5cf5fa583b556457d34a46ce7b940913a66 Mon Sep 17 00:00:00 2001 From: mortezadadgar Date: Sat, 11 Nov 2023 02:11:10 +0330 Subject: fix(completion): make sure the buffer name is valid (#25975) Problem: crash from set complete+=f open a empty buffer C-N Solution: make sure the buffer name is valid. regression from ae4ca4edf89ece433b61e8bf92c412298b58d9ea --- src/nvim/insexpand.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/insexpand.c b/src/nvim/insexpand.c index 78654d8b14..31275ff339 100644 --- a/src/nvim/insexpand.c +++ b/src/nvim/insexpand.c @@ -3334,7 +3334,7 @@ static bool get_next_completion_match(int type, ins_compl_next_state_T *st, pos_ static void get_next_bufname_token(void) { FOR_ALL_BUFFERS(b) { - if (b->b_p_bl) { + if (b->b_p_bl && b->b_sfname != NULL) { char *start = get_past_head(b->b_sfname); char *current = start; char *p = (char *)path_next_component(start); -- cgit