File tree Expand file tree Collapse file tree 1 file changed +1
-11
lines changed
Expand file tree Collapse file tree 1 file changed +1
-11
lines changed Original file line number Diff line number Diff line change 1919
2020---- ----------------------------------------------------------------------------
2121
22- --- @param unencoded string
23- --- @return string
24- local function urlEncode (unencoded )
25- local encoded = unencoded :gsub (
26- " ([^%w%-_.~])" ,
27- function (c ) return string.format (" %%%02X" , string.byte (c )) end
28- )
29- return encoded
30- end
31-
3222--- opens current buffer in the browser & copies the link to the clipboard
3323--- normal mode: link to file
3424--- visual mode: link to selected lines
@@ -76,7 +66,7 @@ function M.githubUrl(what)
7666 end
7767 end
7868 local type = what == " blame" and " blame" or " blob"
79- url = url .. (" /%s/%s/%s%s" ):format (type , hash , urlEncode (pathInRepo ), location )
69+ url = url .. (" /%s/%s/%s%s" ):format (type , hash , vim . uri_encode (pathInRepo ), location )
8070
8171 vim .ui .open (url )
8272 vim .fn .setreg (" +" , url ) -- copy to clipboard
You can’t perform that action at this time.
0 commit comments