1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2025-12-20 22:07:58 +01:00

Fix some crap. Closes issue #145.

This commit is contained in:
Kris Maglione
2009-11-09 08:09:27 -05:00
parent 884411c39c
commit ce2b7893e4
5 changed files with 63 additions and 63 deletions

View File

@@ -1363,7 +1363,7 @@ const CommandLine = Module("commandline", {
this.wildIndex = util.Math.constrain(this.wildIndex + 1, 0, this.wildtypes.length - 1); this.wildIndex = util.Math.constrain(this.wildIndex + 1, 0, this.wildtypes.length - 1);
this.preview(); this.preview();
this._statusTimer.tell(); commandline._statusTimer.tell();
} }
if (this.items.length == 0) if (this.items.length == 0)

View File

@@ -1076,7 +1076,7 @@ const Commands = Module("commands", {
arguments: [cmd.name], arguments: [cmd.name],
literalArg: cmd.replacementText literalArg: cmd.replacementText
} }
for ([k, cmd] in Iterator(this._exCommands)) for ([k, cmd] in Iterator(commands._exCommands))
if (cmd.user && cmd.replacementText) if (cmd.user && cmd.replacementText)
] ]
}); });

View File

@@ -58,9 +58,9 @@ const File = Class("File", {
else else
file.initWithPath(expandedPath); file.initWithPath(expandedPath);
} }
file = XPCSafeJSObjectWrapper(file); let self = XPCSafeJSObjectWrapper(file);
file.__proto__ = File.prototype; self.__proto__ = File.prototype;
return file; return self;
}, },
/** /**
@@ -154,9 +154,9 @@ const File = Class("File", {
encoding = options["fileencoding"]; encoding = options["fileencoding"];
if (mode == ">>") if (mode == ">>")
mode = self.MODE_WRONLY | self.MODE_CREATE | self.MODE_APPEND; mode = File.MODE_WRONLY | File.MODE_CREATE | File.MODE_APPEND;
else if (!mode || mode == ">") else if (!mode || mode == ">")
mode = self.MODE_WRONLY | self.MODE_CREATE | self.MODE_TRUNCATE; mode = File.MODE_WRONLY | File.MODE_CREATE | File.MODE_TRUNCATE;
if (!perms) if (!perms)
perms = 0644; perms = 0644;
@@ -186,6 +186,59 @@ const File = Class("File", {
return true; return true;
}, },
}, { }, {
/**
* @property {number} Open for reading only.
* @final
*/
MODE_RDONLY: 0x01,
/**
* @property {number} Open for writing only.
* @final
*/
MODE_WRONLY: 0x02,
/**
* @property {number} Open for reading and writing.
* @final
*/
MODE_RDWR: 0x04,
/**
* @property {number} If the file does not exist, the file is created.
* If the file exists, this flag has no effect.
* @final
*/
MODE_CREATE: 0x08,
/**
* @property {number} The file pointer is set to the end of the file
* prior to each write.
* @final
*/
MODE_APPEND: 0x10,
/**
* @property {number} If the file exists, its length is truncated to 0.
* @final
*/
MODE_TRUNCATE: 0x20,
/**
* @property {number} If set, each write will wait for both the file
* data and file status to be physically updated.
* @final
*/
MODE_SYNC: 0x40,
/**
* @property {number} With MODE_CREATE, if the file does not exist, the
* file is created. If the file already exists, no action and NULL
* is returned.
* @final
*/
MODE_EXCL: 0x80,
expandPathList: function (list) list.split(",").map(this.expandPath).join(","), expandPathList: function (list) list.split(",").map(this.expandPath).join(","),
@@ -310,59 +363,6 @@ const IO = Module("io", {
*/ */
File: File, File: File,
/**
* @property {number} Open for reading only.
* @final
*/
MODE_RDONLY: 0x01,
/**
* @property {number} Open for writing only.
* @final
*/
MODE_WRONLY: 0x02,
/**
* @property {number} Open for reading and writing.
* @final
*/
MODE_RDWR: 0x04,
/**
* @property {number} If the file does not exist, the file is created.
* If the file exists, this flag has no effect.
* @final
*/
MODE_CREATE: 0x08,
/**
* @property {number} The file pointer is set to the end of the file
* prior to each write.
* @final
*/
MODE_APPEND: 0x10,
/**
* @property {number} If the file exists, its length is truncated to 0.
* @final
*/
MODE_TRUNCATE: 0x20,
/**
* @property {number} If set, each write will wait for both the file
* data and file status to be physically updated.
* @final
*/
MODE_SYNC: 0x40,
/**
* @property {number} With MODE_CREATE, if the file does not exist, the
* file is created. If the file already exists, no action and NULL
* is returned.
* @final
*/
MODE_EXCL: 0x80,
/** /**
* @property {Object} The current file sourcing context. As a file is * @property {Object} The current file sourcing context. As a file is
* being sourced the 'file' and 'line' properties of this context * being sourced the 'file' and 'line' properties of this context
@@ -871,7 +871,7 @@ lookup:
liberator.assert(args.length <= 1, "E172: Only one file name allowed"); liberator.assert(args.length <= 1, "E172: Only one file name allowed");
let filename = args[0] || io.getRCFile(null, true).path; let filename = args[0] || io.getRCFile(null, true).path;
let file = io.File(filename); let file = File(filename);
liberator.assert(!file.exists() || args.bang, liberator.assert(!file.exists() || args.bang,
"E189: \"" + filename + "\" exists (add ! to override)"); "E189: \"" + filename + "\" exists (add ! to override)");

View File

@@ -419,7 +419,7 @@ const Mappings = Module("mappings", {
arguments: [map.names[0]], arguments: [map.names[0]],
literalArg: map.rhs literalArg: map.rhs
} }
for (map in this._mappingsIterator(modes, this._user)) for (map in mappings._mappingsIterator(modes, mappings._user))
if (map.rhs && map.noremap == noremap && !isMultiMode(map, this.name)) if (map.rhs && map.noremap == noremap && !isMultiMode(map, this.name))
]; ];
} }

View File

@@ -729,7 +729,7 @@ Module("highlight", {
if (scheme == "default") if (scheme == "default")
highlight.clear(); highlight.clear();
else else
liberator.assert(!io.sourceFromRuntimePath(["colors/" + scheme + ".vimp"]), liberator.assert(io.sourceFromRuntimePath(["colors/" + scheme + ".vimp"]),
"E185: Cannot find color scheme " + scheme); "E185: Cannot find color scheme " + scheme);
autocommands.trigger("ColorScheme", { name: scheme }); autocommands.trigger("ColorScheme", { name: scheme });
}, },