konradsz / igrep

Interactive Grep
MIT License
641 stars 17 forks source link

Add support for Sublime Text editor #32

Closed jfcherng closed 1 year ago

jfcherng commented 1 year ago

Greeting. I would like to add support for the Sublime Text editor.

I don't have the environment to test this but it seems to be quite simple by referencing https://github.com/konradsz/igrep/pull/28.

But there is one thing that I don't understand and may need some help: how the --editor option sublime_text can be correlated to Editor::SublimeText? I don't see any special treatment for code-insiders v.s. Editor::CodeInsiders.

p.s. the command to open a file with Sublime Text is sublime_text MY_FILE_PATH:LINE_NUM.

konradsz commented 1 year ago

Hi, first of all, thank you for your contribution :) code-insiders comes from #[strum(serialize_all = "lowercase")] attribute on Editor enum. When it comes to Sublime Text - isn't the binary named subl instead of sublime_text? What OS do you use?

jfcherng commented 1 year ago

When it comes to Sublime Text - isn't the binary named subl instead of sublime_text?

All 3 platforms has both executables. But it looks like the ST staff suggested sublime_text in https://github.com/sublimehq/sublime_text/issues/5760. But yes, I remember that subl is called the command line utility 😕.

Iirc, the official installation adds neither of those binaries into PATH though...

Bobo1239 commented 1 year ago

The official Arch Linux packages only have a subl binary.

jfcherng commented 1 year ago

Thanks. Changed to subl. As for the Windows flickering issue with subl.exe, working is better than not working (currently) anyway.