Open annulen opened 4 years ago
Yes, we do use xdg-open
for opening files.
Allowing opening files with a custom editor command shouldn't be too difficult. I will look into it when I can find some time.
As for opening at a specific line number, how do you define the "current hunk"? Is it the hunk in which the cursor is? Is that something intuitive that other users can guess?
As for opening at a specific line number, how do you define the "current hunk"? Is it the hunk in which the cursor is? Is that something intuitive that other users can guess?
I'm not really competent in UX, but it could work for example as a button-like control "Open in editor" in a corner of chunk area, or just action in context menu.
Here is an example of how GUI for customization of editor command is implemented in other program (Alleyoop):
In my opinion we should distinguish between opening a file and opening a file for editing. While it is true, that most tracked files are text files, it is not universal true. Thus I think we should keep using xdg-open
(or platform dependent equivalents) for the Open
action and should add a Edit
or Open for Edit
action with a user editable command for editing. Maybe this could be overloaded into one action, if we follow the result of the text
attribute of the path, if it is a text file, then use the custom command, if not use xdg-open
.
It seems like git-gui is using
xdg-open
or something like that when clicking on "link" with current file name. It would be great if it was possible to use custom editor with given arguments instead. Bonus points if git-gui could allow passing line number corresponding to currently reviewed diff chunk.