Skip to content

Commit

Permalink
fix: dont crash if bash treesitter parser is not installed
Browse files Browse the repository at this point in the history
  • Loading branch information
oysandvik94 committed Jul 28, 2024
1 parent cf4316b commit 5686c66
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ftplugin/curl.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
vim.bo.syntax = "sh"
vim.bo.commentstring = "# %s"

vim.treesitter.language.register("bash", "curl")
local bash_lang_installed, _ = pcall(vim.treesitter.language.register, "bash", "curl")

if bash_lang_installed then
return
end

-- Custom highlights for curl-specific elements
local query = vim.treesitter.query.parse(
Expand Down

0 comments on commit 5686c66

Please sign in to comment.