mirror of
https://github.com/folke/snacks.nvim
synced 2025-08-03 18:28:38 +00:00
fix(gitbrowse): fix the regex in url_patterns (#133)
## Description The `remote` is used as a regex pattern, so the dot in the `"github.com"` means any character. This PR correct the regexes in default `url_patterns`.aa38175c00/lua/snacks/gitbrowse.lua (L40-L49)
aa38175c00/lua/snacks/gitbrowse.lua (L68-L72)
Test code: ```lua print(require("snacks").gitbrowse.get_url("https://githubacom.com/folke/snacks.nvim")) ``` ## Related Issue(s) <!-- If this PR fixes any issues, please link to the issue here. - Fixes #<issue_number> --> ## Screenshots **Before**  **After** 
This commit is contained in:
parent
aebffe535b
commit
cfa7dea08a
1 changed files with 2 additions and 2 deletions
|
@ -38,11 +38,11 @@ local defaults = {
|
|||
{ "%.git$" , "" },
|
||||
},
|
||||
url_patterns = {
|
||||
["github.com"] = {
|
||||
["github%.com"] = {
|
||||
branch = "/tree/{branch}",
|
||||
file = "/blob/{branch}/{file}#L{line}",
|
||||
},
|
||||
["gitlab.com"] = {
|
||||
["gitlab%.com"] = {
|
||||
branch = "/-/tree/{branch}",
|
||||
file = "/-/blob/{branch}/{file}#L{line}",
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue