mirror of
https://github.com/ThePrimeagen/harpoon.git
synced 2025-07-13 17:40:25 +00:00
Merge pull request #182 from pranavrao145/feat/makefile
chore(dev): added Makefile and fixed lint workflow
This commit is contained in:
commit
d3d3d22b62
2
.github/workflows/lint.yml
vendored
2
.github/workflows/lint.yml
vendored
@ -15,4 +15,4 @@ jobs:
|
|||||||
sudo luarocks install luacheck
|
sudo luarocks install luacheck
|
||||||
|
|
||||||
- name: Lint
|
- name: Lint
|
||||||
run: luacheck lua/harpoon
|
run: luacheck lua/ --globals vim
|
||||||
|
9
Makefile
Normal file
9
Makefile
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
fmt:
|
||||||
|
echo "===> Formatting"
|
||||||
|
stylua lua/ --config-path=.stylua.toml
|
||||||
|
|
||||||
|
lint:
|
||||||
|
echo "===> Linting"
|
||||||
|
luacheck lua/ --globals vim
|
||||||
|
|
||||||
|
pr-ready: fmt lint
|
@ -1,11 +1,8 @@
|
|||||||
local action_set = require("telescope.actions.set")
|
|
||||||
local action_state = require("telescope.actions.state")
|
local action_state = require("telescope.actions.state")
|
||||||
local action_utils = require("telescope.actions.utils")
|
local action_utils = require("telescope.actions.utils")
|
||||||
local entry_display = require("telescope.pickers.entry_display")
|
local entry_display = require("telescope.pickers.entry_display")
|
||||||
local finders = require("telescope.finders")
|
local finders = require("telescope.finders")
|
||||||
local pickers = require("telescope.pickers")
|
local pickers = require("telescope.pickers")
|
||||||
local previewers = require("telescope.previewers")
|
|
||||||
local sorters = require("telescope.sorters")
|
|
||||||
local conf = require("telescope.config").values
|
local conf = require("telescope.config").values
|
||||||
local harpoon = require("harpoon")
|
local harpoon = require("harpoon")
|
||||||
local harpoon_mark = require("harpoon.mark")
|
local harpoon_mark = require("harpoon.mark")
|
||||||
@ -34,13 +31,12 @@ local generate_new_finder = function()
|
|||||||
{ remaining = true },
|
{ remaining = true },
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
local make_display = function(entry)
|
local make_display = function()
|
||||||
return displayer({
|
return displayer({
|
||||||
tostring(entry.index),
|
tostring(entry.index),
|
||||||
line,
|
line,
|
||||||
})
|
})
|
||||||
end
|
end
|
||||||
local line = entry.filename .. ":" .. entry.row .. ":" .. entry.col
|
|
||||||
return {
|
return {
|
||||||
value = entry,
|
value = entry,
|
||||||
ordinal = line,
|
ordinal = line,
|
||||||
@ -75,9 +71,10 @@ local delete_harpoon_mark = function(prompt_bufnr)
|
|||||||
end)
|
end)
|
||||||
return results
|
return results
|
||||||
end
|
end
|
||||||
|
|
||||||
local selections = get_selections()
|
local selections = get_selections()
|
||||||
for _, selection in ipairs(selections) do
|
for _, current_selection in ipairs(selections) do
|
||||||
harpoon_mark.rm_file(selection.filename)
|
harpoon_mark.rm_file(current_selection.filename)
|
||||||
end
|
end
|
||||||
|
|
||||||
local current_picker = action_state.get_current_picker(prompt_bufnr)
|
local current_picker = action_state.get_current_picker(prompt_bufnr)
|
||||||
@ -107,8 +104,9 @@ return function(opts)
|
|||||||
attach_mappings = function(_, map)
|
attach_mappings = function(_, map)
|
||||||
map("i", "<c-d>", delete_harpoon_mark)
|
map("i", "<c-d>", delete_harpoon_mark)
|
||||||
map("n", "<c-d>", delete_harpoon_mark)
|
map("n", "<c-d>", delete_harpoon_mark)
|
||||||
map("i", "<c-p>", move_mark_up)
|
-- TODO: implement move_mark_up
|
||||||
map("n", "<c-p>", move_mark_up)
|
-- map("i", "<c-p>", move_mark_up)
|
||||||
|
-- map("n", "<c-p>", move_mark_up)
|
||||||
map("i", "<c-n>", move_mark_down)
|
map("i", "<c-n>", move_mark_down)
|
||||||
map("n", "<c-n>", move_mark_down)
|
map("n", "<c-n>", move_mark_down)
|
||||||
return true
|
return true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user