linrongbin16 / gitlinker.nvim

Maintained fork of ruifm's gitlinker, refactored with bug fixes, ssh aliases, blame support and other improvements.
GNU General Public License v3.0
141 stars 8 forks source link

fix(url): fix url encoding issue #226

Closed linrongbin16 closed 6 months ago

linrongbin16 commented 6 months ago

Fix #224 .

I add an example that a file path contains multiple whitespaces here: https://github.com/linrongbin16/gitlinker.nvim/blob/4ce2bd4ceecf22393226f62b77074913f6aa4209/minimal_init/test%20cases/this%20is%20a%20file%20contains%20whitespaces.txt?plain=1#L1

The thing is:

  1. The generated url is not encoded in URL format.
  2. If open this url (with GitLink!) in browser, the browser (for my, it's google chrome) will auto encode the url into URI format, so it's still working for a browser.

Regression Test

Platforms

Hosts

Functions

codecov[bot] commented 6 months ago

Codecov Report

Attention: Patch coverage is 25.00000% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 77.61%. Comparing base (0ff97f4) to head (24569e9).

Files Patch % Lines
lua/gitlinker.lua 0.00% 2 Missing :warning:
lua/gitlinker/linker.lua 50.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #226 +/- ## ========================================== + Coverage 73.81% 77.61% +3.79% ========================================== Files 9 9 Lines 802 804 +2 ========================================== + Hits 592 624 +32 + Misses 210 180 -30 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.