Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 14 additions & 0 deletions src/ace/commands.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import prompt from "dialogs/prompt";
import fsOperation from "fileSystem";
import actions from "handlers/quickTools";
import keyBindings from "lib/keyBindings";
Expand Down Expand Up @@ -119,6 +120,19 @@ const commands = [
},
readOnly: true,
},
{
name: "openInAppBrowser",
description: "Open In-App Browser",
async exec() {
const url = await prompt("Enter url", "", "url", {
placeholder: "http://",
match: /^https?:\/\/.+/,
});
if (url) {
acode.exec("open-inapp-browser", url);
}
},
},
{
name: "toggleFullscreen",
description: "Toggle full screen mode",
Expand Down
5 changes: 4 additions & 1 deletion src/lib/commands.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import changeEncoding from "palettes/changeEncoding";
import changeMode from "palettes/changeMode";
import commandPalette from "palettes/commandPalette";
import findFile from "palettes/findFile";
import browser from "plugins/browser";
import help from "settings/helpSettings";
import mainSettings from "settings/mainSettings";
import Url from "utils/Url";
Expand Down Expand Up @@ -236,7 +237,9 @@ export default {
"resize-editor"() {
editorManager.editor.resize(true);
},

"open-inapp-browser"(url) {
browser.open(url);
},
run() {
editorManager.activeFile[
appSettings.value.useCurrentFileForPreview ? "runFile" : "run"
Expand Down