diff options
-rw-r--r-- | src/nvim/insexpand.c | 2 | ||||
-rw-r--r-- | test/functional/editor/completion_spec.lua | 2 |
2 files changed, 2 insertions, 2 deletions
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); diff --git a/test/functional/editor/completion_spec.lua b/test/functional/editor/completion_spec.lua index cb5e0b0b14..51f30543e3 100644 --- a/test/functional/editor/completion_spec.lua +++ b/test/functional/editor/completion_spec.lua @@ -1237,7 +1237,7 @@ describe('completion', function() bufname = 'C:\\foo\\bar.txt' hidden = 'C:\\fooA\\.hidden' end - command('set complete+=f | edit '.. bufname ..' | edit '..hidden) + command('set complete+=f | edit '..bufname..' | edit '..hidden..' | enew') feed('i<C-n>') screen:expect{grid=[[ |