mirror of
https://github.com/ThePrimeagen/harpoon.git
synced 2025-07-13 17:40:25 +00:00
chore: lint
This commit is contained in:
parent
5a3195e7bf
commit
d043904d1e
@ -49,26 +49,17 @@ function M.setup_autocmds_and_keymaps(bufnr)
|
||||
end
|
||||
|
||||
vim.api.nvim_buf_set_option(bufnr, "filetype", "harpoon")
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"q",
|
||||
function() M.run_toggle_command("q") end,
|
||||
{ buffer = bufnr, silent = true }
|
||||
)
|
||||
vim.keymap.set("n", "q", function()
|
||||
M.run_toggle_command("q")
|
||||
end, { buffer = bufnr, silent = true })
|
||||
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<Esc>",
|
||||
function() M.run_toggle_command("Esc") end,
|
||||
{ buffer = bufnr, silent = true }
|
||||
)
|
||||
vim.keymap.set("n", "<Esc>", function()
|
||||
M.run_toggle_command("Esc")
|
||||
end, { buffer = bufnr, silent = true })
|
||||
|
||||
vim.keymap.set(
|
||||
"n",
|
||||
"<CR>",
|
||||
function() M.run_select_command() end,
|
||||
{ buffer = bufnr, silent = true }
|
||||
)
|
||||
vim.keymap.set("n", "<CR>", function()
|
||||
M.run_select_command()
|
||||
end, { buffer = bufnr, silent = true })
|
||||
|
||||
vim.api.nvim_create_autocmd({ "BufWriteCmd" }, {
|
||||
group = HarpoonGroup,
|
||||
|
@ -59,7 +59,7 @@ local function read_data()
|
||||
|
||||
local out_data = path:read()
|
||||
|
||||
if not out_data or out_data == '' then
|
||||
if not out_data or out_data == "" then
|
||||
write_data({})
|
||||
out_data = path:read()
|
||||
end
|
||||
|
@ -100,7 +100,10 @@ end
|
||||
---@return HarpoonList
|
||||
function HarpoonList:removeAt(index)
|
||||
if self.items[index] then
|
||||
Logger:log("HarpoonList:removeAt", { item = self.items[index], index = index })
|
||||
Logger:log(
|
||||
"HarpoonList:removeAt",
|
||||
{ item = self.items[index], index = index }
|
||||
)
|
||||
Listeners.listeners:emit(
|
||||
Listeners.event_names.REMOVE,
|
||||
{ list = self, item = self.items[index], idx = index }
|
||||
|
@ -51,7 +51,7 @@ function HarpoonLog:log(...)
|
||||
|
||||
table.insert(self.lines, table.concat(lines, " "))
|
||||
|
||||
while #self.lines > self.max_lines do
|
||||
while #self.lines > self.max_lines do
|
||||
table.remove(self.lines, 1)
|
||||
end
|
||||
end
|
||||
|
@ -14,8 +14,8 @@ describe("harpoon", function()
|
||||
end)
|
||||
|
||||
it("new lines with vim.inspect get removed too", function()
|
||||
Logger:log({hello = "world", world = "hello"})
|
||||
eq({ "{ hello = \"world\", world = \"hello\" }" }, Logger.lines)
|
||||
Logger:log({ hello = "world", world = "hello" })
|
||||
eq({ '{ hello = "world", world = "hello" }' }, Logger.lines)
|
||||
end)
|
||||
|
||||
it("max lines", function()
|
||||
@ -25,6 +25,4 @@ describe("harpoon", function()
|
||||
Logger:log("two")
|
||||
eq({ "two" }, Logger.lines)
|
||||
end)
|
||||
|
||||
end)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user