Skip to content

Commit

Permalink
feat: open the blame by default
Browse files Browse the repository at this point in the history
  • Loading branch information
psyclaudeZ committed Nov 16, 2024
1 parent cc0d803 commit cb98e04
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lua/gh-portal/init.lua
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
local M = {}

M.config = {
branch = "main",
enterprise_url = "github.com",
branch = "main",
should_show_blame = true,
}

function M.setup(opts)
Expand Down Expand Up @@ -48,7 +49,7 @@ function M.setup(opts)
local escaped_path = vim.fn.shellescape(path)
local relative_path = vim.fn.system(string.format('git ls-files --full-name %s', escaped_path)):gsub("\n$", "")
local current_line = vim.fn.line('.')
local url = string.format("https://%s/%s/%s/blob/%s/%s#L%s", host_url, username, repo, branch, relative_path, current_line)
url = string.format("https://%s/%s/%s/%s/%s/%s#L%s", host_url, username, repo, M.config.should_show_blame and "blame" or "blob" , branch, relative_path, current_line)

local os_name = vim.loop.os_uname().sysname
-- TODO: other OS
Expand Down

0 comments on commit cb98e04

Please sign in to comment.