Add jumpable method
This commit is contained in:
@@ -101,6 +101,10 @@ function neogen.jump_next()
|
||||
neogen.utilities.cursor.jump()
|
||||
end
|
||||
|
||||
function neogen.jumpable()
|
||||
return neogen.utilities.cursor.jumpable()
|
||||
end
|
||||
|
||||
function neogen.generate_command()
|
||||
vim.api.nvim_command('command! -range -bar Neogen lua require("neogen").generate()')
|
||||
end
|
||||
|
||||
@@ -14,11 +14,13 @@ end
|
||||
--- It removes the extmark afterwards.
|
||||
neogen.utilities.cursor.go_next_extmark = function()
|
||||
local extm_list = vim.api.nvim_buf_get_extmarks(0, neogen_ns, 0, -1, {})
|
||||
if #extm_list ~= 0 then
|
||||
|
||||
vim.api.nvim_win_set_cursor(0, { extm_list[1][2] + 1, extm_list[1][3] })
|
||||
|
||||
if #extm_list ~= 0 then
|
||||
vim.api.nvim_buf_del_extmark(0, neogen_ns, extm_list[1][1])
|
||||
end
|
||||
if #extm_list ~= 0 then
|
||||
vim.api.nvim_win_set_cursor(0, { extm_list[1][2] + 1, extm_list[1][3] })
|
||||
return true
|
||||
else
|
||||
return false
|
||||
@@ -39,3 +41,12 @@ neogen.utilities.cursor.del_extmarks = function()
|
||||
vim.api.nvim_buf_del_extmark(0, neogen_ns, v[1])
|
||||
end
|
||||
end
|
||||
|
||||
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 true
|
||||
else
|
||||
return false
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user