dotfiles

Personal dotfiles
git clone https://git.bracken.jp/dotfiles.git
Log | Files | Refs | LICENSE

commit a0ac249bbc0fc59f96900b124071e14fd764134c
parent aa19d32490511875e4b8f4d2702272b1a335423f
Author: Chris Bracken <chris@bracken.jp>
Date:   Mon, 25 May 2026 23:02:54 +0900

nvim: use pcall for treesitter setup

In case of error (e.g. treesitter not installed on this machine) catch
the error and continue. This isn't a huge problem and not worth erroring
out over on buffer load.

Diffstat:
M.config/nvim/lua/plugins/languages.lua | 4++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/.config/nvim/lua/plugins/languages.lua b/.config/nvim/lua/plugins/languages.lua @@ -125,8 +125,8 @@ return { local lang = vim.treesitter.language.get_lang(args.match) if not lang then return end - local parser = vim.treesitter.get_parser(args.buf, lang) - if not parser then return end + local ok, parser = pcall(vim.treesitter.get_parser, args.buf, lang) + if not ok or not parser then return end vim.treesitter.start(args.buf, lang) end,