diff --git a/common/content/buffer.js b/common/content/buffer.js index 83e70d90..a61c86a9 100644 --- a/common/content/buffer.js +++ b/common/content/buffer.js @@ -1143,7 +1143,7 @@ const Buffer = Module("buffer", { let arg = args[0]; // FIXME: arg handling is a bit of a mess, check for filename - dactyl.assert(!arg || arg[0] == ">" && !dactyl.has("Win32"), + dactyl.assert(!arg || arg[0] == ">" && !dactyl.has("WINNT"), "E488: Trailing characters"); options.withContext(function () { diff --git a/common/content/dactyl.js b/common/content/dactyl.js index 21a16857..bf5eee55 100644 --- a/common/content/dactyl.js +++ b/common/content/dactyl.js @@ -1155,12 +1155,6 @@ const Dactyl = Module("dactyl", { } }, - // return the platform normalized to Vim values - getPlatformFeature: function () { - let platform = services.get("runtime").OS; - return /^Mac/.test(platform) ? "MacUnix" : platform == "Win32" ? "Win32" : "Unix"; - }, - // TODO: move this getMenuItems: function () { function addChildren(node, parent) { @@ -1193,7 +1187,9 @@ const Dactyl = Module("dactyl", { } }, { config: function () { - config.features.push(Dactyl.getPlatformFeature()); + // TODO: is the OS really a config feature? I think not. --djk + let os = services.get("runtime").OS; + config.features.push(os == "WINNT" || os == "Darwin" ? os : "Unix"); }, // Only general options are added here, which are valid for all Dactyl extensions diff --git a/common/content/editor.js b/common/content/editor.js index 23c3470f..304e2ac1 100644 --- a/common/content/editor.js +++ b/common/content/editor.js @@ -54,7 +54,7 @@ const Editor = Module("editor", { }, pasteClipboard: function () { - if (dactyl.has("Win32")) { + if (dactyl.has("WINNT")) { this.executeCommand("cmd_paste"); return; } diff --git a/common/content/events.js b/common/content/events.js index 0a292365..da72f548 100644 --- a/common/content/events.js +++ b/common/content/events.js @@ -524,14 +524,14 @@ const Events = Module("events", { // https://bugzilla.mozilla.org/show_bug.cgi?query_format=specific&order=relevance+desc&bug_status=__open__&id=432951 // --- // - // The following fixes are only activated if dactyl.has("MacUnix"). + // The following fixes are only activated if dactyl.has("Darwin"). // Technically, they prevent mappings from (and // if your fancy keyboard permits such things), but // these mappings are probably pathological ( // certainly is on Windows), and so it is probably - // harmless to remove the has("MacUnix") if desired. + // harmless to remove the has("Darwin") if desired. // - else if (dactyl.has("MacUnix") && event.ctrlKey && charCode >= 27 && charCode <= 31) { + else if (dactyl.has("Darwin") && event.ctrlKey && charCode >= 27 && charCode <= 31) { if (charCode == 27) { // [Ctrl-Bug 1/5] the bug key = "Esc"; modifier = modifier.replace("C-", ""); diff --git a/common/content/io.js b/common/content/io.js index ab759325..67f87017 100644 --- a/common/content/io.js +++ b/common/content/io.js @@ -182,7 +182,7 @@ const IO = Module("io", { let rcFile1 = File.joinPaths(dir, "." + config.name + "rc"); let rcFile2 = File.joinPaths(dir, "_" + config.name + "rc"); - if (dactyl.has("Win32")) + if (dactyl.has("WINNT")) [rcFile1, rcFile2] = [rcFile2, rcFile1]; if (rcFile1.exists() && rcFile1.isFile()) @@ -226,9 +226,9 @@ const IO = Module("io", { if (File.isAbsolutePath(program)) file = io.File(program, true); else { - let dirs = services.get("environment").get("PATH").split(dactyl.has("Win32") ? ";" : ":"); + let dirs = services.get("environment").get("PATH").split(dactyl.has("WINNT") ? ";" : ":"); // Windows tries the CWD first TODO: desirable? - if (dactyl.has("Win32")) + if (dactyl.has("WINNT")) dirs = [io.getCurrentDirectory().path].concat(dirs); lookup: @@ -240,7 +240,7 @@ lookup: // TODO: couldn't we just palm this off to the start command? // automatically try to add the executable path extensions on windows - if (dactyl.has("Win32")) { + if (dactyl.has("WINNT")) { let extensions = services.get("environment").get("PATHEXT").split(";"); for (let [, extension] in Iterator(extensions)) { file = File.joinPaths(dir, program + extension); @@ -459,7 +459,7 @@ lookup: stdin.write(input); // TODO: implement 'shellredir' - if (dactyl.has("Win32")) { + if (dactyl.has("WINNT")) { command = "cd /D " + this._cwd.path + " && " + command + " > " + stdout.path + " 2>&1" + " < " + stdin.path; var res = this.run(options["shell"], options["shellcmdflag"].split(/\s+/).concat(command), true); } @@ -513,7 +513,7 @@ lookup: const rtpvar = config.idname + "_RUNTIME"; let rtp = services.get("environment").get(rtpvar); if (!rtp) { - rtp = "~/" + (dactyl.has("Win32") ? "" : ".") + config.name; + rtp = "~/" + (dactyl.has("WINNT") ? "" : ".") + config.name; services.get("environment").set(rtpvar, rtp); } return rtp; @@ -703,7 +703,7 @@ lookup: }; completion.environment = function environment(context) { - let command = dactyl.has("Win32") ? "set" : "env"; + let command = dactyl.has("WINNT") ? "set" : "env"; let lines = io.system(command).split("\n"); lines.pop(); @@ -750,7 +750,7 @@ lookup: completion.shellCommand = function shellCommand(context) { context.title = ["Shell Command", "Path"]; context.generate = function () { - let dirNames = services.get("environment").get("PATH").split(RegExp(dactyl.has("Win32") ? ";" : ":")); + let dirNames = services.get("environment").get("PATH").split(RegExp(dactyl.has("WINNT") ? ";" : ":")); let commands = []; for (let [, dirName] in Iterator(dirNames)) { @@ -780,7 +780,7 @@ lookup: }, options: function () { var shell, shellcmdflag; - if (dactyl.has("Win32")) { + if (dactyl.has("WINNT")) { shell = "cmd.exe"; // TODO: setting 'shell' to "something containing sh" updates // 'shellcmdflag' appropriately at startup on Windows in Vim diff --git a/common/content/tabs.js b/common/content/tabs.js index 5cafc431..d96b2cc8 100644 --- a/common/content/tabs.js +++ b/common/content/tabs.js @@ -21,7 +21,7 @@ const Tabs = Module("tabs", { this._lastBufferSwitchArgs = ""; this._lastBufferSwitchSpecial = true; - let fragment = dactyl.has("MacUnix") ? "tab-mac" : "tab"; + let fragment = dactyl.has("Darwin") ? "tab-mac" : "tab"; this.tabBinding = styles.addSheet(true, "tab-binding", "chrome://browser/content/browser.xul", ".tabbrowser-tab { -moz-binding: url(chrome://dactyl/content/bindings.xml#" + fragment + ") !important; }" + // FIXME: better solution for themes? diff --git a/common/locale/en-US/options.xml b/common/locale/en-US/options.xml index ec3340e3..fec277a1 100644 --- a/common/locale/en-US/options.xml +++ b/common/locale/en-US/options.xml @@ -1165,7 +1165,7 @@ 'shell' 'sh' 'shell' 'sh' string - $SHELL or sh, Win32: cmd.exe + $SHELL or sh, Windows: cmd.exe

Shell to use for executing :! and :run commands.

@@ -1177,7 +1177,7 @@ 'shellcmdflag' 'shcf' string - -c, Win32: /c + -c, Windows: /c

Flag passed to shell when executing :! and :run commands.