use nvim_get_option_value instead of nvim{,_buf,_win}_get_option

This commit is contained in:
hrsh7th
2024-05-17 22:56:28 +09:00
parent abacd4cb7f
commit 5260e5e8ec
5 changed files with 5 additions and 5 deletions

View File

@@ -47,7 +47,7 @@ end
---@return { [1]: integer, [2]: integer }
api.get_cursor = function()
if api.is_cmdline_mode() then
return { math.min(vim.o.lines, vim.o.lines - (vim.api.nvim_get_option('cmdheight') - 1)), vim.fn.getcmdpos() - 1 }
return { math.min(vim.o.lines, vim.o.lines - (vim.api.nvim_get_option_value('cmdheight', {}) - 1)), vim.fn.getcmdpos() - 1 }
end
return vim.api.nvim_win_get_cursor(0)
end