mirror of
https://github.com/ThePrimeagen/harpoon.git
synced 2025-07-14 01:50:27 +00:00
fix: removed harpoon check from loop, lint/format fix
This commit is contained in:
parent
e27f59e938
commit
2ed6b3e8ae
@ -146,7 +146,7 @@ require("harpoon").setup({
|
|||||||
save_on_toggle = false,
|
save_on_toggle = false,
|
||||||
save_on_change = true,
|
save_on_change = true,
|
||||||
enter_on_sendcmd = false,
|
enter_on_sendcmd = false,
|
||||||
excluded_filetypes = {"harpoon"}
|
excluded_filetypes = { "harpoon" }
|
||||||
},
|
},
|
||||||
... your other configs ...
|
... your other configs ...
|
||||||
})
|
})
|
||||||
|
@ -157,7 +157,7 @@ M.setup = function(config)
|
|||||||
["save_on_toggle"] = false,
|
["save_on_toggle"] = false,
|
||||||
["save_on_change"] = true,
|
["save_on_change"] = true,
|
||||||
["enter_on_sendcmd"] = false,
|
["enter_on_sendcmd"] = false,
|
||||||
["excluded_filetypes"] = {"harpoon"}
|
["excluded_filetypes"] = { "harpoon" },
|
||||||
},
|
},
|
||||||
}, expand_dir(
|
}, expand_dir(
|
||||||
c_config
|
c_config
|
||||||
|
@ -118,10 +118,21 @@ end
|
|||||||
local function filter_filetype()
|
local function filter_filetype()
|
||||||
local current_filetype = vim.bo.filetype
|
local current_filetype = vim.bo.filetype
|
||||||
local excluded_filetypes = harpoon.get_global_settings().excluded_filetypes
|
local excluded_filetypes = harpoon.get_global_settings().excluded_filetypes
|
||||||
|
|
||||||
|
if current_filetype == "harpoon" then
|
||||||
|
log.error("filter_filetype(): You can't add harpoon to the harpoon")
|
||||||
|
error("You can't add harpoon to the harpoon")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
for filetype = 1, #excluded_filetypes do
|
for filetype = 1, #excluded_filetypes do
|
||||||
if(current_filetype == excluded_filetypes[filetype] or current_filetype == "harpoon") then
|
if current_filetype == excluded_filetypes[filetype] then
|
||||||
log.error('filter_filetype(): This filetype cannot be added or is included in the "excluded_filetypes" option')
|
log.error(
|
||||||
error('This filetype cannot be added or is included in the "excluded_filetypes" option')
|
'filter_filetype(): This filetype cannot be added or is included in the "excluded_filetypes" option'
|
||||||
|
)
|
||||||
|
error(
|
||||||
|
'This filetype cannot be added or is included in the "excluded_filetypes" option'
|
||||||
|
)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@ -192,7 +203,7 @@ M.valid_index = function(idx)
|
|||||||
end
|
end
|
||||||
|
|
||||||
M.add_file = function(file_name_or_buf_id)
|
M.add_file = function(file_name_or_buf_id)
|
||||||
filter_filetype();
|
filter_filetype()
|
||||||
local buf_name = get_buf_name(file_name_or_buf_id)
|
local buf_name = get_buf_name(file_name_or_buf_id)
|
||||||
log.trace("add_file():", buf_name)
|
log.trace("add_file():", buf_name)
|
||||||
|
|
||||||
@ -309,7 +320,6 @@ M.set_current_at = function(idx)
|
|||||||
local config = harpoon.get_mark_config()
|
local config = harpoon.get_mark_config()
|
||||||
local current_idx = M.get_index_of(buf_name)
|
local current_idx = M.get_index_of(buf_name)
|
||||||
|
|
||||||
|
|
||||||
-- Remove it if it already exists
|
-- Remove it if it already exists
|
||||||
if M.valid_index(current_idx) then
|
if M.valid_index(current_idx) then
|
||||||
config.marks[current_idx] = create_mark("")
|
config.marks[current_idx] = create_mark("")
|
||||||
|
Loading…
x
Reference in New Issue
Block a user