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