mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 16:07:59 +01:00
Fix zoom level display for fractional percentages.
This commit is contained in:
11
common/bootstrap.js
vendored
11
common/bootstrap.js
vendored
@@ -31,17 +31,6 @@ function httpGet(url) {
|
||||
return xmlhttp;
|
||||
}
|
||||
|
||||
function writeFile(file, buf) {
|
||||
let fstream = Cc["@mozilla.org/network/file-output-stream;1"].createInstance(Ci.nsIFileOutputStream);
|
||||
let stream = Cc["@mozilla.org/intl/converter-output-stream;1"].createInstance(Ci.nsIConverterOutputStream);
|
||||
|
||||
fstream.init(file, 0x02 | 0x08 | 0x20, parseInt("0644", 8), 0);
|
||||
stream.init(fstream, "UTF-8", 0, "?");
|
||||
stream.writeString(buf);
|
||||
stream.close();
|
||||
fstream.close();
|
||||
}
|
||||
|
||||
let initialized = false;
|
||||
let addon = null;
|
||||
let basePath = null;
|
||||
|
||||
@@ -31,7 +31,7 @@ var AutoCommands = Module("autocommands", {
|
||||
*/
|
||||
add: function (events, regexp, cmd) {
|
||||
events.forEach(function (event) {
|
||||
this._store.push(AutoCommand(event, Option.parse.regexplist(regexp), cmd));
|
||||
this._store.push(AutoCommand(event, Option.parse.regexplist(regexp.source || regexp), cmd));
|
||||
}, this);
|
||||
},
|
||||
|
||||
|
||||
@@ -1181,8 +1181,9 @@ var Dactyl = Module("dactyl", XPCOM(Ci.nsISupportsWeakReference, ModuleBase), {
|
||||
*/
|
||||
reportError: function reportError(error, echo) {
|
||||
if (error instanceof FailedAssertion || error.message === "Interrupted") {
|
||||
let prefix = io.sourcing ? io.sourcing.file + ":" + io.sourcing.line + ": " : "";
|
||||
if (error.message)
|
||||
dactyl.echoerr(template.linkifyHelp(error.message));
|
||||
dactyl.echoerr(template.linkifyHelp(prefix + error.message));
|
||||
else
|
||||
dactyl.beep();
|
||||
return;
|
||||
|
||||
@@ -309,7 +309,7 @@ var StatusLine = Module("statusline", {
|
||||
if (percent == 100)
|
||||
this.widgets.zoomlevel.value = "";
|
||||
else {
|
||||
percent = (" " + percent).substr(-3);
|
||||
percent = (" " + Math.round(percent)).substr(-3);
|
||||
if (full)
|
||||
this.widgets.zoomlevel.value = " [" + percent + "%]";
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user