Skip to content

Commit 764681e

Browse files
committed
fix: :config_edit open editor not video player
1 parent d06f4bd commit 764681e

1 file changed

Lines changed: 12 additions & 1 deletion

File tree

src/glide/browser/base/content/browser-excmds.mts

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@ class GlideExcmdsClass {
786786

787787
const file = Cc["@mozilla.org/file/local;1"]!.createInstance(Ci.nsIFile);
788788
file.initWithPath(GlideBrowser.config_path);
789-
file.launch();
789+
launch_as_text(file);
790790
break;
791791
}
792792

@@ -1042,3 +1042,14 @@ export function get_command_info(
10421042
}
10431043

10441044
export const GlideExcmds = new GlideExcmdsClass();
1045+
1046+
function launch_as_text(file: nsIFile): void {
1047+
try {
1048+
const mime_service = Cc["@mozilla.org/mime;1"]!.getService(Ci.nsIMIMEService);
1049+
const mime_info = mime_service.getFromTypeAndExtension("text/plain", "");
1050+
mime_info.preferredAction = Ci.nsIHandlerInfo.useSystemDefault;
1051+
mime_info.launchWithFile(file);
1052+
} catch {
1053+
file.launch();
1054+
}
1055+
}

0 commit comments

Comments
 (0)