Skip to content

Commit

Permalink
fix: scope highlight from extmark hook
Browse files Browse the repository at this point in the history
fix #808
  • Loading branch information
lukas-reineke committed Dec 24, 2023
1 parent 3084950 commit 0dca928
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions lua/ibl/hooks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -207,12 +207,12 @@ M.builtin = {

local start_row, start_col = scope:start()
local end_row, end_col = scope:end_()
local start_line = vim.api.nvim_buf_get_lines(bufnr, start_row, start_row + 1, false)
local end_line = vim.api.nvim_buf_get_lines(bufnr, end_row, end_row + 1, false)
local end_pos
local start_pos
local start_pos_scope
local end_pos_scope
local start_line = vim.api.nvim_buf_get_lines(bufnr, start_row, start_row + 1, false)[1]
local end_line = vim.api.nvim_buf_get_lines(bufnr, end_row, end_row + 1, false)[1]
local end_pos = {}
local start_pos = {}
local start_pos_scope = {}
local end_pos_scope = {}

local function inspect_pos(pos)
return vim.api.nvim_buf_get_extmarks(bufnr, -1, pos, pos, {
Expand All @@ -221,12 +221,12 @@ M.builtin = {
})
end

if end_line[1] then
end_pos = inspect_pos { end_row, end_line[1]:find "%S" - 1 }
if end_line then
end_pos = inspect_pos { end_row, end_line:find "%S" - 1 }
end_pos_scope = inspect_pos { end_row, end_col - 1 }
end
if start_line[1] then
start_pos = inspect_pos { start_row, #start_line[1] - 1 }
if start_line then
start_pos = inspect_pos { start_row, #start_line - 1 }
start_pos_scope = inspect_pos { start_row, start_col }
end

Expand Down

0 comments on commit 0dca928

Please sign in to comment.