mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-13 17:00:09 -04:00
Merge pull request #61 from theHamsta/cleanup-postspace
Remove postspaces and avoid one global
This commit is contained in:
commit
fb672f2630
3 changed files with 6 additions and 6 deletions
|
|
@ -45,7 +45,7 @@ local function highlight_health(lang)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
function locals_health(lang)
|
local function locals_health(lang)
|
||||||
if not queries.get_query(lang, "locals") then
|
if not queries.get_query(lang, "locals") then
|
||||||
health_warn("No `locals.scm` query found for " .. lang, {
|
health_warn("No `locals.scm` query found for " .. lang, {
|
||||||
"Open an issue at https://github.com/nvim-treesitter/nvim-treesitter"
|
"Open an issue at https://github.com/nvim-treesitter/nvim-treesitter"
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ local function select_incremental(get_parent)
|
||||||
-- initialize incremental selection with current range
|
-- initialize incremental selection with current range
|
||||||
if #buf_state.selection.nodes == 0 then
|
if #buf_state.selection.nodes == 0 then
|
||||||
local cur_range = buf_state.selection.range
|
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("."))
|
local _, cursor_row, cursor_col, _ = unpack(vim.fn.getpos("."))
|
||||||
cur_range = { cursor_row, cursor_col, cursor_row, cursor_col + 1 }
|
cur_range = { cursor_row, cursor_col, cursor_row, cursor_col + 1 }
|
||||||
end
|
end
|
||||||
|
|
@ -35,9 +35,9 @@ local function select_incremental(get_parent)
|
||||||
local root = buf_state.parser.tree:root()
|
local root = buf_state.parser.tree:root()
|
||||||
if not root then return end
|
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
|
else
|
||||||
node = get_parent(buf_state.selection.nodes[#buf_state.selection.nodes])
|
node = get_parent(buf_state.selection.nodes[#buf_state.selection.nodes])
|
||||||
end
|
end
|
||||||
|
|
||||||
if not node then return end
|
if not node then return end
|
||||||
|
|
|
||||||
|
|
@ -28,8 +28,8 @@ function M.update()
|
||||||
local row = cursor[1]
|
local row = cursor[1]
|
||||||
local col = cursor[2]
|
local col = cursor[2]
|
||||||
if row == buf_config.cursor_pos.row
|
if row == buf_config.cursor_pos.row
|
||||||
and col == buf_config.cursor_pos.col
|
and col == buf_config.cursor_pos.col
|
||||||
and mode == g_mode
|
and mode == g_mode
|
||||||
then
|
then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue