aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorStephan Seitz <stephan.seitz@fau.de>2021-07-11 22:59:06 +0200
committerGitHub <noreply@github.com>2021-07-11 20:59:06 +0000
commit4571d57251a3e026face8d87ed9642d8b8bf84c0 (patch)
treeacf46f9e0ca2ebcf6d6dc126a4b1c291ff5c9e3b /lua
parentUpdate lockfile.json (#1554) (diff)
downloadnvim-treesitter-4571d57251a3e026face8d87ed9642d8b8bf84c0.tar
nvim-treesitter-4571d57251a3e026face8d87ed9642d8b8bf84c0.tar.gz
nvim-treesitter-4571d57251a3e026face8d87ed9642d8b8bf84c0.tar.bz2
nvim-treesitter-4571d57251a3e026face8d87ed9642d8b8bf84c0.tar.lz
nvim-treesitter-4571d57251a3e026face8d87ed9642d8b8bf84c0.tar.xz
nvim-treesitter-4571d57251a3e026face8d87ed9642d8b8bf84c0.tar.zst
nvim-treesitter-4571d57251a3e026face8d87ed9642d8b8bf84c0.zip
New stylua version (#1555)
Diffstat (limited to 'lua')
-rw-r--r--lua/nvim-treesitter/configs.lua5
-rw-r--r--lua/nvim-treesitter/tsrange.lua9
2 files changed, 5 insertions, 9 deletions
diff --git a/lua/nvim-treesitter/configs.lua b/lua/nvim-treesitter/configs.lua
index 9d54ed8b8..cb02e7032 100644
--- a/lua/nvim-treesitter/configs.lua
+++ b/lua/nvim-treesitter/configs.lua
@@ -467,9 +467,8 @@ end
-- A module should contain an attach and detach function.
-- @param mod the module table
function M.is_module(mod)
- return type(mod) == "table" and ((type(mod.attach) == "function" and type(mod.detach) == "function") or type(
- mod.module_path
- ) == "string")
+ return type(mod) == "table"
+ and ((type(mod.attach) == "function" and type(mod.detach) == "function") or type(mod.module_path) == "string")
end
-- Initializes built-in modules and any queued modules
diff --git a/lua/nvim-treesitter/tsrange.lua b/lua/nvim-treesitter/tsrange.lua
index 767cab779..c816d6b25 100644
--- a/lua/nvim-treesitter/tsrange.lua
+++ b/lua/nvim-treesitter/tsrange.lua
@@ -51,12 +51,9 @@ end
function TSRange:parent()
local root = ts_utils.get_root_for_position(self[1], self[2])
- return root and root:named_descendant_for_range(
- self.start_pos[1],
- self.start_pos[2],
- self.end_pos[1],
- self.end_pos[2]
- ) or nil
+ return root
+ and root:named_descendant_for_range(self.start_pos[1], self.start_pos[2], self.end_pos[1], self.end_pos[2])
+ or nil
end
function TSRange:field() end