From b77ac736613aa8f22f1f2ab0b326bb7a169516a8 Mon Sep 17 00:00:00 2001 From: Daniel Mathiot Date: Wed, 8 Sep 2021 13:43:41 +0200 Subject: [PATCH] Fix error in tab completion --- lua/neogen/utilities/cursor.lua | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lua/neogen/utilities/cursor.lua b/lua/neogen/utilities/cursor.lua index d199c19..1845c60 100644 --- a/lua/neogen/utilities/cursor.lua +++ b/lua/neogen/utilities/cursor.lua @@ -57,6 +57,9 @@ end --- Verifies if the cursor is in the last annotated part neogen.utilities.cursor.jumpable = function() local extm_list = vim.api.nvim_buf_get_extmarks(0, neogen_ns, 0, -1, {}) + if #extm_list == 0 then + return false + end local cursor = vim.api.nvim_win_get_cursor(0) if cursor[1] > extm_list[#extm_list][2] or cursor[1] < extm_list[1][2] then return false