mirror of
https://github.com/ThePrimeagen/harpoon.git
synced 2025-07-16 11:00:23 +00:00
Merge pull request #31 from brandoncc/dont-mark-nil-or-empty-string
Dont mark nil or empty string
This commit is contained in:
commit
af09f2c99b
@ -74,14 +74,19 @@ local function swap(a_idx, b_idx)
|
|||||||
config.marks[b_idx] = tmp
|
config.marks[b_idx] = tmp
|
||||||
end
|
end
|
||||||
|
|
||||||
M.add_file = function()
|
M.add_file = function(file_name_or_buf_id)
|
||||||
local buf_name = get_buf_name()
|
local buf_name = get_buf_name(file_name_or_buf_id)
|
||||||
|
|
||||||
if valid_index(get_index_of(buf_name)) then
|
if valid_index(get_index_of(buf_name)) then
|
||||||
-- we don't alter file layout.
|
-- we don't alter file layout.
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if buf_name == "" or buf_name == nil then
|
||||||
|
error("Couldn't find a valid file name to mark, sorry.")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
local config = harpoon.get_mark_config()
|
local config = harpoon.get_mark_config()
|
||||||
for idx = 1, #config.marks do
|
for idx = 1, #config.marks do
|
||||||
if config.marks[idx] == nil then
|
if config.marks[idx] == nil then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user