Skip to content
Merged
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
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

## 3.4.0 - 2026-03-07

### Changed

- Only add column offset for last line when first line's column is non-zero for GitHub. (#70)

## 3.3.0 - 2025-11-05

### Changed
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "githubinator",
"displayName": "Githubinator",
"description": "Quickly open files on Github and other providers. View blame information, copy permalinks and more. See the \"commands\" section of the README for more details.",
"version": "3.3.0",
"version": "3.4.0",
"publisher": "chdsbd",
"license": "SEE LICENSE IN LICENSE",
"icon": "images/logo256.png",
Expand Down Expand Up @@ -471,6 +471,7 @@
"lodash": "^4.17.21",
"mz": "^2.7.0"
},
"packageManager": "yarn@1.22.22",
"volta": {
"node": "18.20.3",
"yarn": "1.22.22"
Expand Down
3 changes: 3 additions & 0 deletions src/providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,9 @@ export class Github extends BaseProvider {
let line = `L${start.line + 1}`
if (start.character !== 0) {
line += `C${start.character + 1}`
} else {
line += `-L${end.line + 1}`
return line
}
line += `-L${end.line + 1}`
if (end.character !== 0) {
Expand Down
41 changes: 41 additions & 0 deletions src/test/suite/providers.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,47 @@ suite("Github", async () => {
assert.deepEqual(result, expected)
}
})
test("if column of first line is 0, last line should be 0", async () => {
for (let url of [
"git@github.mycompany.com:recipeyak/recipeyak.git",
"git@github.mycompany.com:recipeyak/recipeyak",
"org-XYZ123@github.mycompany.com:recipeyak/recipeyak",
"ssh://git@github.mycompany.com/recipeyak/recipeyak.git",
]) {
async function findRemote(hostname: string) {
return url
}
const gh = new Github(
{
github: { hostnames: ["github.mycompany.com"] },
},
"origin",
findRemote,
)
const result = await gh.getUrls({
selection: {
start: { line: 17, character: 0 },
end: { line: 24, character: 5 },
},
head: createBranch("master"),
relativeFilePath: "frontend/src/components/App.tsx",
})
const expected = {
blobUrl:
"https://github.mycompany.com/recipeyak/recipeyak/blob/master/frontend/src/components/App.tsx#L18-L25",
blameUrl:
"https://github.mycompany.com/recipeyak/recipeyak/blame/master/frontend/src/components/App.tsx#L18-L25",
compareUrl:
"https://github.mycompany.com/recipeyak/recipeyak/compare/master",
historyUrl:
"https://github.mycompany.com/recipeyak/recipeyak/commits/master/frontend/src/components/App.tsx",
prUrl:
"https://github.mycompany.com/recipeyak/recipeyak/pull/new/master",
repoUrl: "https://github.mycompany.com/recipeyak/recipeyak",
}
assert.deepEqual(result, expected)
}
})
})

suite("Gitlab", async () => {
Expand Down