Skip to content

Commit ec1ae4b

Browse files
committed
UI: added f2 command for online help
1 parent 14fbf72 commit ec1ae4b

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

src/platform/sdl/syswm.cpp

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -107,16 +107,20 @@ void launchDebug(const char *file) {
107107

108108
void browseFile(const char *url) {
109109
if (fork() == 0) {
110-
fclose(stderr);
111-
fclose(stdin);
112-
fclose(stdout);
113-
execlp("htmlview", "htmlview", url, NULL);
114-
execlp("google-chrome", "google-chrome", url, NULL);
115-
execlp("chromium-browser", "chromium-browser", url, NULL);
116-
execlp("firefox", "firefox", url, NULL);
117-
execlp("mozilla", "mozilla", url, NULL);
118-
// exit in case exec failed
119-
::exit(0);
110+
const char *browser[] = {
111+
"sensible-browser",
112+
"xdg-open",
113+
"gnome-open",
114+
"htmlview",
115+
"firefox",
116+
"google-chrome",
117+
NULL
118+
};
119+
for (int i = 0; browser[i] != NULL; i++) {
120+
execlp(browser[i], browser[i], url, NULL);
121+
}
122+
fprintf(stderr, "exec browser failed for %s\n", url);
123+
::exit(1);
120124
}
121125
}
122126

src/ui/textedit.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ const char *helpText =
106106
"SHIFT-<arrow> select\n"
107107
"TAB indent line\n"
108108
"F1,A-h keyword help\n"
109-
"F2, online help\n"
109+
"F2 online help\n"
110110
"F5 debug\n"
111111
"F9, C-r run\n";
112112

0 commit comments

Comments
 (0)