From 1efff797a73cdf184cf358dc50b57b3b874cb1d2 Mon Sep 17 00:00:00 2001 From: theprimeagen Date: Thu, 4 Apr 2024 10:59:34 -0600 Subject: [PATCH] chore: formatting + lint --- lua/harpoon/buffer.lua | 1 - lua/harpoon/config.lua | 12 ++++++++---- lua/harpoon/test/harpoon_spec.lua | 17 ++++++++--------- lua/harpoon/test/list_spec.lua | 1 - lua/harpoon/test/ui_spec.lua | 4 ++-- 5 files changed, 18 insertions(+), 17 deletions(-) diff --git a/lua/harpoon/buffer.lua b/lua/harpoon/buffer.lua index 60a207d..a6a9fd3 100644 --- a/lua/harpoon/buffer.lua +++ b/lua/harpoon/buffer.lua @@ -1,4 +1,3 @@ -local utils = require("harpoon.utils") local HarpoonGroup = require("harpoon.autocmd") local M = {} diff --git a/lua/harpoon/config.lua b/lua/harpoon/config.lua index 0edb78e..a8ddcd9 100644 --- a/lua/harpoon/config.lua +++ b/lua/harpoon/config.lua @@ -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 diff --git a/lua/harpoon/test/harpoon_spec.lua b/lua/harpoon/test/harpoon_spec.lua index 71bf2ab..1d9398c 100644 --- a/lua/harpoon/test/harpoon_spec.lua +++ b/lua/harpoon/test/harpoon_spec.lua @@ -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) diff --git a/lua/harpoon/test/list_spec.lua b/lua/harpoon/test/list_spec.lua index 505e254..7adbbc3 100644 --- a/lua/harpoon/test/list_spec.lua +++ b/lua/harpoon/test/list_spec.lua @@ -270,7 +270,6 @@ describe("list", function() { value = "four" }, { value = "one" }, }, list.items) - end) it("resolve_displayed", function() diff --git a/lua/harpoon/test/ui_spec.lua b/lua/harpoon/test/ui_spec.lua index 26a06d7..58d5d98 100644 --- a/lua/harpoon/test/ui_spec.lua +++ b/lua/harpoon/test/ui_spec.lua @@ -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())