Closed ahmedelgabri closed 7 years ago
I like the first idea. I'll implement that thanks 👍
Also another improvement can be that the URL use Github permanent links instead of the normal ones https://help.github.com/articles/getting-permanent-links-to-files/, this way links will always work.
Use --scheme=exact
instead.
Use
--scheme=exact
instead.
Thanks, didn't know about that one 👍
I checked the current implementation and found that it is nearly impossible with the current implementation so I decided to NOT implement that. Sorry for the inconvenience.
Note
mode()
always return n
in command so it cannot be used to find if the command was called from visual mode-range=%
return an entire range in default so it can be used if the command was called from visual selection by options.__range__ == [1, line('$')]
Gita show
should respect the selected line but Gita browse
so using -range=%
would break the current behavior of Gita show
No worries, It's a bit little annoyance but not a deal breaker. Also I wonder how fugitive is doing it though?
Also I wonder how fugitive is doing it though?
I don't know but fugitive use a different command like Gbrowse
and Greae
so it would use -range=%
to check it I guess.
Currently if you trigger
:Gita browse
in normal mode while the cursor for example is on L34, it will open the file on github on line 34 which most probably not the behavior needed because if I want a specific line or range I will highlight them in visual mode & call:Gita browse
.So I guess it will be better if you just open the file in normal mode while you highlight the lines in visual mode, similar to fugitive behavior.
Also another improvement can be that the URL use Github permanent links instead of the normal ones https://help.github.com/articles/getting-permanent-links-to-files/, this way links will always work.