summaryrefslogtreecommitdiff
path: root/lua/nvim-treesitter/highlight.lua
diff options
context:
space:
mode:
authorSantos Gallegos <stsewd@protonmail.com>2021-07-04 16:12:17 -0500
committerGitHub <noreply@github.com>2021-07-04 21:12:17 +0000
commitbe8f65608796e50aa2e2da5452849c263558f0ed (patch)
tree39f6057de9026ab312c3bb838e773910129b5575 /lua/nvim-treesitter/highlight.lua
parent90f15d9bf750e35666e029174481dafbe5fde817 (diff)
Use stylua for autoformat code (#1480)
Diffstat (limited to 'lua/nvim-treesitter/highlight.lua')
-rw-r--r--lua/nvim-treesitter/highlight.lua15
1 files changed, 7 insertions, 8 deletions
diff --git a/lua/nvim-treesitter/highlight.lua b/lua/nvim-treesitter/highlight.lua
index a106c620..e082bd5e 100644
--- a/lua/nvim-treesitter/highlight.lua
+++ b/lua/nvim-treesitter/highlight.lua
@@ -1,11 +1,10 @@
local api = vim.api
local ts = vim.treesitter
-local parsers = require'nvim-treesitter.parsers'
-local configs = require'nvim-treesitter.configs'
+local parsers = require "nvim-treesitter.parsers"
+local configs = require "nvim-treesitter.configs"
-local M = {
-}
+local M = {}
local hlmap = vim.treesitter.highlighter.hl_map
@@ -104,7 +103,7 @@ hlmap["variable.builtin"] = "TSVariableBuiltin"
function M.attach(bufnr, lang)
local parser = parsers.get_parser(bufnr, lang)
- local config = configs.get_module('highlight')
+ local config = configs.get_module "highlight"
for k, v in pairs(config.custom_captures) do
hlmap[k] = v
@@ -112,9 +111,9 @@ function M.attach(bufnr, lang)
ts.highlighter.new(parser, {})
- local is_table = type(config.additional_vim_regex_highlighting) == 'table'
+ local is_table = type(config.additional_vim_regex_highlighting) == "table"
if config.additional_vim_regex_highlighting and (not is_table or config.additional_vim_regex_highlighting[lang]) then
- api.nvim_buf_set_option(bufnr, 'syntax', 'ON')
+ api.nvim_buf_set_option(bufnr, "syntax", "ON")
end
end
@@ -122,7 +121,7 @@ function M.detach(bufnr)
if ts.highlighter.active[bufnr] then
ts.highlighter.active[bufnr]:destroy()
end
- api.nvim_buf_set_option(bufnr, 'syntax', 'ON')
+ api.nvim_buf_set_option(bufnr, "syntax", "ON")
end
return M