From 9ebf052feff78411c2f68bfa94d0a17cbf1e6d85 Mon Sep 17 00:00:00 2001 From: Alexander Frolov <9749087+fxrlv@users.noreply.github.com> Date: Mon, 20 Oct 2025 15:15:21 +0200 Subject: [PATCH] fix(gitbrowse): fixed urls for gitlab (#2073) ## Description GitLab highlighting uses a different scheme for range of lines https://gitlab.com/gitlab-org/gitlab/-/blob/fb2f3ce787ff4836ba827396ad30e89271711109/app/assets/javascripts/repository/mixins/highlight_mixin.js#L114 ## Related Issue(s) ## Screenshots --- doc/snacks-gitbrowse.txt | 4 ++-- docs/gitbrowse.md | 4 ++-- lua/snacks/gitbrowse.lua | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/snacks-gitbrowse.txt b/doc/snacks-gitbrowse.txt index a993c14a..a6f54d0b 100644 --- a/doc/snacks-gitbrowse.txt +++ b/doc/snacks-gitbrowse.txt @@ -79,8 +79,8 @@ Open the repo of the active file in the browser (e.g., GitHub) }, ["gitlab%.com"] = { branch = "/-/tree/{branch}", - file = "/-/blob/{branch}/{file}#L{line_start}-L{line_end}", - permalink = "/-/blob/{commit}/{file}#L{line_start}-L{line_end}", + file = "/-/blob/{branch}/{file}#L{line_start}-{line_end}", + permalink = "/-/blob/{commit}/{file}#L{line_start}-{line_end}", commit = "/-/commit/{commit}", }, ["bitbucket%.org"] = { diff --git a/docs/gitbrowse.md b/docs/gitbrowse.md index a21dd610..68a5ce4e 100644 --- a/docs/gitbrowse.md +++ b/docs/gitbrowse.md @@ -67,8 +67,8 @@ Open the repo of the active file in the browser (e.g., GitHub) }, ["gitlab%.com"] = { branch = "/-/tree/{branch}", - file = "/-/blob/{branch}/{file}#L{line_start}-L{line_end}", - permalink = "/-/blob/{commit}/{file}#L{line_start}-L{line_end}", + file = "/-/blob/{branch}/{file}#L{line_start}-{line_end}", + permalink = "/-/blob/{commit}/{file}#L{line_start}-{line_end}", commit = "/-/commit/{commit}", }, ["bitbucket%.org"] = { diff --git a/lua/snacks/gitbrowse.lua b/lua/snacks/gitbrowse.lua index 65f89a1c..489c8770 100644 --- a/lua/snacks/gitbrowse.lua +++ b/lua/snacks/gitbrowse.lua @@ -56,8 +56,8 @@ local defaults = { }, ["gitlab%.com"] = { branch = "/-/tree/{branch}", - file = "/-/blob/{branch}/{file}#L{line_start}-L{line_end}", - permalink = "/-/blob/{commit}/{file}#L{line_start}-L{line_end}", + file = "/-/blob/{branch}/{file}#L{line_start}-{line_end}", + permalink = "/-/blob/{commit}/{file}#L{line_start}-{line_end}", commit = "/-/commit/{commit}", }, ["bitbucket%.org"] = {