Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lua/high-str/tools/tool-exportimport/export.lua
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function M.export()
local file_cords = import.load_file(opts.saving_path .. "cords.txt") or {}
local final_cords = {}

if (next(file_cords) ~= nil) then
if (file_cords ~= 0 and next(file_cords) ~= nil) then
final_cords = vim.tbl_deep_extend("force", file_cords, cords)
for file, _ in pairs(final_cords) do
for local_file, _ in pairs(cords) do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,11 @@ function M.highlight_visual_selection(hi_group, beg_line, beg_col, end_line, end
)

if (beg_line == end_line) then
-- After import, highlight is triggered with line 0
-- Somehow, the command cannot be removed, but we can catch the exception here
if (beg_line == 0) then
return
end
api.nvim_buf_add_highlight(current_buffer, 0, hi_group, beg_line - 1, beg_col, end_col)
else
-- api.nvim_buf_clear_namespace(current_buffer, 0, beg_line - 1, beg_line)
Expand Down