chore: formatting + lint

This commit is contained in:
theprimeagen 2024-04-04 10:59:34 -06:00
parent 5b344710b7
commit 1efff797a7
5 changed files with 18 additions and 17 deletions

View File

@ -1,4 +1,3 @@
local utils = require("harpoon.utils")
local HarpoonGroup = require("harpoon.autocmd")
local M = {}

View File

@ -140,7 +140,8 @@ function M.get_default_config()
end
local row = list_item.context.row
local row_text = vim.api.nvim_buf_get_lines(0, row - 1, row, false)
local row_text =
vim.api.nvim_buf_get_lines(0, row - 1, row, false)
local col = #row_text[1]
if list_item.context.col > col then
@ -154,9 +155,12 @@ function M.get_default_config()
})
if edited then
Extensions.extensions:emit(Extensions.event_names.POSITION_UPDATED, {
list_item = list_item
})
Extensions.extensions:emit(
Extensions.event_names.POSITION_UPDATED,
{
list_item = list_item,
}
)
end
end

View File

@ -43,7 +43,7 @@ local function out_of_bounds_test(out, expected)
"qux",
})
vim.api.nvim_buf_delete(to_unload, {force = true})
vim.api.nvim_buf_delete(to_unload, { force = true })
-- i have to force it to be out of bounds
list.items[1].context = out
@ -51,9 +51,8 @@ local function out_of_bounds_test(out, expected)
harpoon:list():select(1)
eq({
{ value = file_name, context = expected}
{ value = file_name, context = expected },
}, harpoon:list().items)
end
describe("harpoon", function()
@ -126,30 +125,30 @@ describe("harpoon", function()
it("out of bounds test: row over", function()
out_of_bounds_test({
row = 5,
col = 3
col = 3,
}, {
row = 4,
col = 3
col = 3,
})
end)
it("out of bounds test: col over", function()
out_of_bounds_test({
row = 4,
col = 4
col = 4,
}, {
row = 4,
col = 3
col = 3,
})
end)
it("out of bounds test: both over", function()
out_of_bounds_test({
row = 5,
col = 4
col = 4,
}, {
row = 4,
col = 3
col = 3,
})
end)

View File

@ -270,7 +270,6 @@ describe("list", function()
{ value = "four" },
{ value = "one" },
}, list.items)
end)
it("resolve_displayed", function()

View File

@ -74,9 +74,9 @@ describe("harpoon", function()
it("ui with replace_at", function()
local one_f = os.tmpname()
local one = utils.create_file(one_f, { "one", })
local one = utils.create_file(one_f, { "one" })
local three_f = os.tmpname()
local three = utils.create_file(three_f, { "three", })
local three = utils.create_file(three_f, { "three" })
local context = { row = 1, col = 0 }
eq(0, harpoon:list():length())