Skip to content

Commit 1aa53ce

Browse files
authored
Merge pull request #4 from F-Joubert/main
Update deprecated nvim_get_option to fix "Invalid option name"
2 parents 1454bf3 + 860575a commit 1aa53ce

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lua/markdown-toc/utils.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function M.process_heading(content, filepath, heading_level_to_match)
2727
local current_buffer = vim.api.nvim_buf_get_name(0)
2828
local relative_path = get_relative_path(current_buffer, filepath)
2929

30-
local expandtab = vim.api.nvim_get_option('expandtab')
30+
local expandtab = vim.api.nvim_get_option_value('expandtab', {})
3131

3232
for _, line in ipairs(lines) do
3333
local heading_level, heading_text = line:match('^(#+)%s*(.+)')
@@ -36,7 +36,7 @@ function M.process_heading(content, filepath, heading_level_to_match)
3636

3737
local indent = string.rep('\t', level)
3838
if expandtab then
39-
local tabstop = vim.api.nvim_get_option('tabstop')
39+
local tabstop = vim.api.nvim_get_option_value('tabstop', {})
4040
indent = string.rep(' ', level * tabstop)
4141
end
4242

0 commit comments

Comments
 (0)