mirror of
https://github.com/ThePrimeagen/harpoon
synced 2024-09-16 21:44:02 +02:00
Merge pull request #182 from pranavrao145/feat/makefile
chore(dev): added Makefile and fixed lint workflow
This commit is contained in:
commit
d3d3d22b62
3 changed files with 17 additions and 10 deletions
2
.github/workflows/lint.yml
vendored
2
.github/workflows/lint.yml
vendored
|
@ -15,4 +15,4 @@ jobs:
|
|||
sudo luarocks install luacheck
|
||||
|
||||
- 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_utils = require("telescope.actions.utils")
|
||||
local entry_display = require("telescope.pickers.entry_display")
|
||||
local finders = require("telescope.finders")
|
||||
local pickers = require("telescope.pickers")
|
||||
local previewers = require("telescope.previewers")
|
||||
local sorters = require("telescope.sorters")
|
||||
local conf = require("telescope.config").values
|
||||
local harpoon = require("harpoon")
|
||||
local harpoon_mark = require("harpoon.mark")
|
||||
|
@ -34,13 +31,12 @@ local generate_new_finder = function()
|
|||
{ remaining = true },
|
||||
},
|
||||
})
|
||||
local make_display = function(entry)
|
||||
local make_display = function()
|
||||
return displayer({
|
||||
tostring(entry.index),
|
||||
line,
|
||||
})
|
||||
end
|
||||
local line = entry.filename .. ":" .. entry.row .. ":" .. entry.col
|
||||
return {
|
||||
value = entry,
|
||||
ordinal = line,
|
||||
|
@ -75,9 +71,10 @@ local delete_harpoon_mark = function(prompt_bufnr)
|
|||
end)
|
||||
return results
|
||||
end
|
||||
|
||||
local selections = get_selections()
|
||||
for _, selection in ipairs(selections) do
|
||||
harpoon_mark.rm_file(selection.filename)
|
||||
for _, current_selection in ipairs(selections) do
|
||||
harpoon_mark.rm_file(current_selection.filename)
|
||||
end
|
||||
|
||||
local current_picker = action_state.get_current_picker(prompt_bufnr)
|
||||
|
@ -107,8 +104,9 @@ return function(opts)
|
|||
attach_mappings = function(_, map)
|
||||
map("i", "<c-d>", delete_harpoon_mark)
|
||||
map("n", "<c-d>", delete_harpoon_mark)
|
||||
map("i", "<c-p>", move_mark_up)
|
||||
map("n", "<c-p>", move_mark_up)
|
||||
-- TODO: implement 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("n", "<c-n>", move_mark_down)
|
||||
return true
|
||||
|
|
Loading…
Reference in a new issue