diff options
author | Matěj Cepl <mcepl@cepl.eu> | 2022-06-05 00:59:11 +0200 |
---|---|---|
committer | Matěj Cepl <mcepl@cepl.eu> | 2024-03-28 17:08:04 +0100 |
commit | 4925f7b8775961ede82f5c1e5a230f52fcdb7be6 (patch) | |
tree | 0acac7590b33897d37c9e913cd5e22891b90efb8 /abbrevURL | |
parent | e6af213dd9a7572e724fa928ae7f98917965d999 (diff) | |
download | vim-suse-changes-4925f7b8775961ede82f5c1e5a230f52fcdb7be6.tar.gz |
feat(osurl,abbrevURL): add abbreviation for GitHub commit URL.
Diffstat (limited to 'abbrevURL')
-rwxr-xr-x | abbrevURL | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -12,9 +12,12 @@ end str = str:gsub("https?://github.com/(.*)/issues/(%d+)", "gh#%1#%2") str = str:gsub("https?://github.com/(.*)/pull/(%d+)", "gh#%1#%2") -str = str:gsub("https?://gitlab.com/(.*)/-/issues/(%d+)", "gl#%1#%2") +str = str:gsub("https?://github.com/(.*)/commit/(%w+)", function (r, i) + return "gh#" .. r .. "@" .. i:sub(1, 12) +end) str = str:gsub("https?://gitlab.com/(.*)/issues/(%d+)", "gl#%1#%2") str = str:gsub("https?://gitlab.com/(.*)/pull/(%d+)", "gl#%1#%2") +str = str:gsub("https?://gitlab.com/(.*)/-/issues/(%d+)", "gl#%1#%2") str = str:gsub("https?://gitlab.com/(.*)/-/pull/(%d+)", "gl#%1#%2") str = str:gsub("https?://gitlab.com/(.*)/-/merge-requests/(%d+)", "gl#%1#%2") str = str:gsub("https?://sourceforge.net/support/tracker.php%?aid=(%d+)", "sh#%1") |