A plugin might want to provide platform specific commands or just different labels for the same command in a Menu or Command Palette.
Example
The FileManager plugin provides the fm_open_in_explorer command, which is labeled "Open in Explorer" on Windows and Linux while using "Open in Finder" on MacOS.
While it is easy to do for any kind of menu (e.g.: Side Bar.sublime-menu):
Problem description
A plugin might want to provide platform specific commands or just different labels for the same command in a Menu or Command Palette.
Example
The FileManager plugin provides the
fm_open_in_explorer
command, which is labeled "Open in Explorer" on Windows and Linux while using "Open in Finder" on MacOS.While it is easy to do for any kind of menu (e.g.: Side Bar.sublime-menu):
... the command needs to specify its own
visible_on_platforms
argument to handle the different labels in the Command Palette at the moment.Preferred solution
Add support for the
platform
key in the Default.sublime-commands file the same way it is used in the Main.sublime-menu.Alternatives
Add support for platform specific Default.sublime-commands files the same way as it is used for Default.sublime-keybindings