mirror of
https://github.com/ThePrimeagen/harpoon.git
synced 2025-07-14 01:50:27 +00:00
chore: formatting + lint
This commit is contained in:
parent
5b344710b7
commit
1efff797a7
@ -1,4 +1,3 @@
|
|||||||
local utils = require("harpoon.utils")
|
|
||||||
local HarpoonGroup = require("harpoon.autocmd")
|
local HarpoonGroup = require("harpoon.autocmd")
|
||||||
|
|
||||||
local M = {}
|
local M = {}
|
||||||
|
@ -140,7 +140,8 @@ function M.get_default_config()
|
|||||||
end
|
end
|
||||||
|
|
||||||
local row = list_item.context.row
|
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]
|
local col = #row_text[1]
|
||||||
|
|
||||||
if list_item.context.col > col then
|
if list_item.context.col > col then
|
||||||
@ -154,9 +155,12 @@ function M.get_default_config()
|
|||||||
})
|
})
|
||||||
|
|
||||||
if edited then
|
if edited then
|
||||||
Extensions.extensions:emit(Extensions.event_names.POSITION_UPDATED, {
|
Extensions.extensions:emit(
|
||||||
list_item = list_item
|
Extensions.event_names.POSITION_UPDATED,
|
||||||
})
|
{
|
||||||
|
list_item = list_item,
|
||||||
|
}
|
||||||
|
)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -43,7 +43,7 @@ local function out_of_bounds_test(out, expected)
|
|||||||
"qux",
|
"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
|
-- i have to force it to be out of bounds
|
||||||
list.items[1].context = out
|
list.items[1].context = out
|
||||||
@ -51,9 +51,8 @@ local function out_of_bounds_test(out, expected)
|
|||||||
harpoon:list():select(1)
|
harpoon:list():select(1)
|
||||||
|
|
||||||
eq({
|
eq({
|
||||||
{ value = file_name, context = expected}
|
{ value = file_name, context = expected },
|
||||||
}, harpoon:list().items)
|
}, harpoon:list().items)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe("harpoon", function()
|
describe("harpoon", function()
|
||||||
@ -126,30 +125,30 @@ describe("harpoon", function()
|
|||||||
it("out of bounds test: row over", function()
|
it("out of bounds test: row over", function()
|
||||||
out_of_bounds_test({
|
out_of_bounds_test({
|
||||||
row = 5,
|
row = 5,
|
||||||
col = 3
|
col = 3,
|
||||||
}, {
|
}, {
|
||||||
row = 4,
|
row = 4,
|
||||||
col = 3
|
col = 3,
|
||||||
})
|
})
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it("out of bounds test: col over", function()
|
it("out of bounds test: col over", function()
|
||||||
out_of_bounds_test({
|
out_of_bounds_test({
|
||||||
row = 4,
|
row = 4,
|
||||||
col = 4
|
col = 4,
|
||||||
}, {
|
}, {
|
||||||
row = 4,
|
row = 4,
|
||||||
col = 3
|
col = 3,
|
||||||
})
|
})
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it("out of bounds test: both over", function()
|
it("out of bounds test: both over", function()
|
||||||
out_of_bounds_test({
|
out_of_bounds_test({
|
||||||
row = 5,
|
row = 5,
|
||||||
col = 4
|
col = 4,
|
||||||
}, {
|
}, {
|
||||||
row = 4,
|
row = 4,
|
||||||
col = 3
|
col = 3,
|
||||||
})
|
})
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
@ -270,7 +270,6 @@ describe("list", function()
|
|||||||
{ value = "four" },
|
{ value = "four" },
|
||||||
{ value = "one" },
|
{ value = "one" },
|
||||||
}, list.items)
|
}, list.items)
|
||||||
|
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it("resolve_displayed", function()
|
it("resolve_displayed", function()
|
||||||
|
@ -74,9 +74,9 @@ describe("harpoon", function()
|
|||||||
|
|
||||||
it("ui with replace_at", function()
|
it("ui with replace_at", function()
|
||||||
local one_f = os.tmpname()
|
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_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 }
|
local context = { row = 1, col = 0 }
|
||||||
|
|
||||||
eq(0, harpoon:list():length())
|
eq(0, harpoon:list():length())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user