Use stylua for autoformat code (#1480)

This commit is contained in:
Santos Gallegos 2021-07-04 16:12:17 -05:00 committed by GitHub
parent 90f15d9bf7
commit be8f656087
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 1181 additions and 979 deletions

View file

@ -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