Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
.luacheckcache
doc/tags
4 changes: 2 additions & 2 deletions lua/gitlinker.lua
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ local function get_buf_range_url_data(mode, user_opts)
return nil
end
mode = mode or "n"
local remote = git.get_branch_remote() or user_opts.remote
local remote = user_opts.remote or git.get_branch_remote()
local repo_url_data = git.get_repo_data(remote)
if not repo_url_data then
return nil
Expand Down Expand Up @@ -138,7 +138,7 @@ function M.get_repo_url(user_opts)
user_opts = vim.tbl_deep_extend("force", opts.get(), user_opts or {})

local repo_url_data = git.get_repo_data(
git.get_branch_remote() or user_opts.remote
user_opts.remote or git.get_branch_remote()
)
if not repo_url_data then
return nil
Expand Down
2 changes: 1 addition & 1 deletion lua/gitlinker/opts.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
local M = {}

local defaults = {
remote = "origin", -- force the use of a specific remote
remote = nil, -- set it to force the use of a specific remote globally
add_current_line_on_normal_mode = true, -- if true adds the line nr in the url for normal mode
action_callback = require("gitlinker.actions").copy_to_clipboard, -- callback for what to do with the url
print_url = true, -- print the url after action
Expand Down