Skip to content

Commit d6d6a2c

Browse files
committed
fix: pcall vim.treesitter.get_parser
Fix #33
1 parent fef2c6f commit d6d6a2c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lua/indentmini/init.lua

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ end
116116
local function make_snapshot(lnum)
117117
local line_text = ffi.string(ml_get(lnum))
118118
local is_empty = #line_text == 0 or only_spaces_or_tabs(line_text)
119-
if is_empty and treesitter.get_parser() then
119+
local ok = pcall(treesitter.get_paser)
120+
if is_empty and ok then
120121
local indent = ts_get_indent(lnum)
121122
if indent then
122123
local snapshot = {

0 commit comments

Comments
 (0)