CMD_OpenFileSystemBrowser

This commit is contained in:
Krzosa Karol
2026-03-21 16:56:36 +01:00
parent cab882de60
commit 4c21026842

View File

@@ -8,6 +8,16 @@ void CMD_OpenUpFolder() {
Open(name);
} RegisterCommand(CMD_OpenUpFolder, "ctrl-o", "Open current's file directory or up directory in other cases");
void CMD_OpenSystemFileBrowser() {
Scratch scratch;
String string = GetPrimaryDirectory();
#if OS_WINDOWS
Open(Format(scratch, "!!explorer %S", string));
#else
Open(Format(scratch, "!!xdg-open %S & disown", string));
#endif
} RegisterCommand(CMD_OpenSystemFileBrowser, "ctrl-alt-r", "Opens the directory of current file in the systems file browser");
void InsertDirectoryNavigation(Buffer *buffer) {
Assert(buffer->is_dir);
Scratch scratch;