Skip to content

Commit 4449bca

Browse files
fix(treesitter): manually start http parser (fix #508)
1 parent 3ad9c74 commit 4449bca

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

ftplugin/http.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@ vim.bo.commentstring = "# %s"
22
vim.wo.conceallevel = 0
33
vim.opt.comments:remove("n:>")
44

5+
-- NOTE: Manually start tree-sitter-http highlighting.
6+
-- Just in case user didn't enabled auto highlighting option.
7+
local ok = pcall(vim.treesitter.start, 0, "http")
8+
if not ok then
9+
vim.notify("Failed to attach tree-sitter-http parser to current buffer", vim.log.levels.ERROR, { title = "rest.nvim" })
10+
end
11+
512
local dotenv = require("rest-nvim.dotenv")
613

714
vim.b._rest_nvim_count = 1

0 commit comments

Comments
 (0)