aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
authorKiyan Yazdani <yazdani.kiyan@protonmail.com>2020-05-22 17:11:59 +0200
committerGitHub <noreply@github.com>2020-05-22 17:11:59 +0200
commitfb672f2630f00ff171b552a1d96b53fc0cd0f288 (patch)
tree2b7b6c514c9431b973d8d1ae4a4ff68188f3ce60 /lua
parentMerge pull request #60 from klauer/doc_missing_eof (diff)
parentRemove postspaces and avoid one global (diff)
downloadnvim-treesitter-fb672f2630f00ff171b552a1d96b53fc0cd0f288.tar
nvim-treesitter-fb672f2630f00ff171b552a1d96b53fc0cd0f288.tar.gz
nvim-treesitter-fb672f2630f00ff171b552a1d96b53fc0cd0f288.tar.bz2
nvim-treesitter-fb672f2630f00ff171b552a1d96b53fc0cd0f288.tar.lz
nvim-treesitter-fb672f2630f00ff171b552a1d96b53fc0cd0f288.tar.xz
nvim-treesitter-fb672f2630f00ff171b552a1d96b53fc0cd0f288.tar.zst
nvim-treesitter-fb672f2630f00ff171b552a1d96b53fc0cd0f288.zip
Merge pull request #61 from theHamsta/cleanup-postspace
Remove postspaces and avoid one global
Diffstat (limited to 'lua')
-rw-r--r--lua/nvim-treesitter/health.lua2
-rw-r--r--lua/nvim-treesitter/incremental_selection.lua6
-rw-r--r--lua/nvim-treesitter/state.lua4
3 files changed, 6 insertions, 6 deletions
diff --git a/lua/nvim-treesitter/health.lua b/lua/nvim-treesitter/health.lua
index a1852162e..ca1e765c7 100644
--- a/lua/nvim-treesitter/health.lua
+++ b/lua/nvim-treesitter/health.lua
@@ -45,7 +45,7 @@ local function highlight_health(lang)
end
end
-function locals_health(lang)
+local function locals_health(lang)
if not queries.get_query(lang, "locals") then
health_warn("No `locals.scm` query found for " .. lang, {
"Open an issue at https://github.com/nvim-treesitter/nvim-treesitter"
diff --git a/lua/nvim-treesitter/incremental_selection.lua b/lua/nvim-treesitter/incremental_selection.lua
index ea7a9f71e..9876f2e01 100644
--- a/lua/nvim-treesitter/incremental_selection.lua
+++ b/lua/nvim-treesitter/incremental_selection.lua
@@ -27,7 +27,7 @@ local function select_incremental(get_parent)
-- initialize incremental selection with current range
if #buf_state.selection.nodes == 0 then
local cur_range = buf_state.selection.range
- if not cur_range then
+ if not cur_range then
local _, cursor_row, cursor_col, _ = unpack(vim.fn.getpos("."))
cur_range = { cursor_row, cursor_col, cursor_row, cursor_col + 1 }
end
@@ -35,9 +35,9 @@ local function select_incremental(get_parent)
local root = buf_state.parser.tree:root()
if not root then return end
- node = root:named_descendant_for_range(cur_range[1]-1, cur_range[2]-1, cur_range[3]-1, cur_range[4]-1)
+ node = root:named_descendant_for_range(cur_range[1]-1, cur_range[2]-1, cur_range[3]-1, cur_range[4]-1)
else
- node = get_parent(buf_state.selection.nodes[#buf_state.selection.nodes])
+ node = get_parent(buf_state.selection.nodes[#buf_state.selection.nodes])
end
if not node then return end
diff --git a/lua/nvim-treesitter/state.lua b/lua/nvim-treesitter/state.lua
index d682bd28f..adff7eeaf 100644
--- a/lua/nvim-treesitter/state.lua
+++ b/lua/nvim-treesitter/state.lua
@@ -28,8 +28,8 @@ function M.update()
local row = cursor[1]
local col = cursor[2]
if row == buf_config.cursor_pos.row
- and col == buf_config.cursor_pos.col
- and mode == g_mode
+ and col == buf_config.cursor_pos.col
+ and mode == g_mode
then
return
end