mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2026-03-29 04:13:32 +02:00
Fix bug.
This commit is contained in:
@@ -657,6 +657,7 @@ var CompletionContext = Class("CompletionContext", {
|
|||||||
}
|
}
|
||||||
catch (e) {
|
catch (e) {
|
||||||
util.reportError(e);
|
util.reportError(e);
|
||||||
|
XML.ignoreWhitespace = XML.prettyPrinting = false;
|
||||||
cache[idx] = util.xmlToDom(
|
cache[idx] = util.xmlToDom(
|
||||||
<div highlight="CompItem" style="white-space: nowrap">
|
<div highlight="CompItem" style="white-space: nowrap">
|
||||||
<li highlight="CompResult">{this.text} </li>
|
<li highlight="CompResult">{this.text} </li>
|
||||||
|
|||||||
@@ -96,7 +96,7 @@ var Template = Module("Template", {
|
|||||||
join: function join(c) function (a, b) a + c + b,
|
join: function join(c) function (a, b) a + c + b,
|
||||||
|
|
||||||
map: function map(iter, func, sep, interruptable) {
|
map: function map(iter, func, sep, interruptable) {
|
||||||
XML.ignoreWhitespace = false; XML.prettyPrinting = false;
|
XML.ignoreWhitespace = XML.prettyPrinting = false;
|
||||||
if (typeof iter.length == "number") // FIXME: Kludge?
|
if (typeof iter.length == "number") // FIXME: Kludge?
|
||||||
iter = array.iterValues(iter);
|
iter = array.iterValues(iter);
|
||||||
let res = <></>;
|
let res = <></>;
|
||||||
@@ -201,7 +201,7 @@ var Template = Module("Template", {
|
|||||||
var desc = this.processor[1].call(this, item, item.description);
|
var desc = this.processor[1].call(this, item, item.description);
|
||||||
}
|
}
|
||||||
|
|
||||||
XML.ignoreWhitespace = false; XML.prettyPrinting = false;
|
XML.ignoreWhitespace = XML.prettyPrinting = false;
|
||||||
// <e4x>
|
// <e4x>
|
||||||
return <div highlight={highlightGroup || "CompItem"} style="white-space: nowrap">
|
return <div highlight={highlightGroup || "CompItem"} style="white-space: nowrap">
|
||||||
<!-- The non-breaking spaces prevent empty elements
|
<!-- The non-breaking spaces prevent empty elements
|
||||||
@@ -227,7 +227,7 @@ var Template = Module("Template", {
|
|||||||
if (help.initialized && !Set.has(help.tags, topic))
|
if (help.initialized && !Set.has(help.tags, topic))
|
||||||
return <span highlight={type || ""}>{text || token}</span>;
|
return <span highlight={type || ""}>{text || token}</span>;
|
||||||
|
|
||||||
XML.ignoreWhitespace = false; XML.prettyPrinting = false;
|
XML.ignoreWhitespace = XML.prettyPrinting = false;
|
||||||
type = type || (/^'.*'$/.test(token) ? "HelpOpt" :
|
type = type || (/^'.*'$/.test(token) ? "HelpOpt" :
|
||||||
/^\[.*\]$|^E\d{3}$/.test(token) ? "HelpTopic" :
|
/^\[.*\]$|^E\d{3}$/.test(token) ? "HelpTopic" :
|
||||||
/^:\w/.test(token) ? "HelpEx" : "HelpKey");
|
/^:\w/.test(token) ? "HelpEx" : "HelpKey");
|
||||||
@@ -247,7 +247,7 @@ var Template = Module("Template", {
|
|||||||
if (help.initialized && !Set.has(help.tags, topic))
|
if (help.initialized && !Set.has(help.tags, topic))
|
||||||
return <>{token}</>;
|
return <>{token}</>;
|
||||||
|
|
||||||
XML.ignoreWhitespace = false; XML.prettyPrinting = false;
|
XML.ignoreWhitespace = XML.prettyPrinting = false;
|
||||||
let tag = (/^'.*'$/.test(token) ? "o" :
|
let tag = (/^'.*'$/.test(token) ? "o" :
|
||||||
/^\[.*\]$|^E\d{3}$/.test(token) ? "t" :
|
/^\[.*\]$|^E\d{3}$/.test(token) ? "t" :
|
||||||
/^:\w/.test(token) ? "ex" : "k");
|
/^:\w/.test(token) ? "ex" : "k");
|
||||||
@@ -287,7 +287,7 @@ var Template = Module("Template", {
|
|||||||
// if "processStrings" is true, any passed strings will be surrounded by " and
|
// if "processStrings" is true, any passed strings will be surrounded by " and
|
||||||
// any line breaks are displayed as \n
|
// any line breaks are displayed as \n
|
||||||
highlight: function highlight(arg, processStrings, clip, bw) {
|
highlight: function highlight(arg, processStrings, clip, bw) {
|
||||||
XML.ignoreWhitespace = false; XML.prettyPrinting = false;
|
XML.ignoreWhitespace = XML.prettyPrinting = false;
|
||||||
// some objects like window.JSON or getBrowsers()._browsers need the try/catch
|
// some objects like window.JSON or getBrowsers()._browsers need the try/catch
|
||||||
try {
|
try {
|
||||||
let str = this.stringify(arg);
|
let str = this.stringify(arg);
|
||||||
@@ -343,6 +343,8 @@ var Template = Module("Template", {
|
|||||||
return this.highlightSubstrings(str, (function () {
|
return this.highlightSubstrings(str, (function () {
|
||||||
if (filter.length == 0)
|
if (filter.length == 0)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
XML.ignoreWhitespace = XML.prettyPrinting = false;
|
||||||
let lcstr = String.toLowerCase(str);
|
let lcstr = String.toLowerCase(str);
|
||||||
let lcfilter = filter.toLowerCase();
|
let lcfilter = filter.toLowerCase();
|
||||||
let start = 0;
|
let start = 0;
|
||||||
@@ -396,7 +398,7 @@ var Template = Module("Template", {
|
|||||||
</>,
|
</>,
|
||||||
|
|
||||||
jumps: function jumps(index, elems) {
|
jumps: function jumps(index, elems) {
|
||||||
XML.ignoreWhitespace = false; XML.prettyPrinting = false;
|
XML.ignoreWhitespace = XML.prettyPrinting = false;
|
||||||
// <e4x>
|
// <e4x>
|
||||||
return <table>
|
return <table>
|
||||||
<tr style="text-align: left;" highlight="Title">
|
<tr style="text-align: left;" highlight="Title">
|
||||||
@@ -422,7 +424,7 @@ var Template = Module("Template", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
options: function options(title, opts, verbose) {
|
options: function options(title, opts, verbose) {
|
||||||
XML.ignoreWhitespace = false; XML.prettyPrinting = false;
|
XML.ignoreWhitespace = XML.prettyPrinting = false;
|
||||||
// <e4x>
|
// <e4x>
|
||||||
return <table>
|
return <table>
|
||||||
<tr highlight="Title" align="left">
|
<tr highlight="Title" align="left">
|
||||||
@@ -449,7 +451,7 @@ var Template = Module("Template", {
|
|||||||
let url = util.fixURI(frame.filename || "unknown");
|
let url = util.fixURI(frame.filename || "unknown");
|
||||||
let path = util.urlPath(url);
|
let path = util.urlPath(url);
|
||||||
|
|
||||||
XML.ignoreWhitespace = false; XML.prettyPrinting = false;
|
XML.ignoreWhitespace = XML.prettyPrinting = false;
|
||||||
return <a xmlns:dactyl={NS} dactyl:command="buffer.viewSource"
|
return <a xmlns:dactyl={NS} dactyl:command="buffer.viewSource"
|
||||||
href={url} path={path} line={frame.lineNumber}
|
href={url} path={path} line={frame.lineNumber}
|
||||||
highlight="URL">{
|
highlight="URL">{
|
||||||
@@ -458,7 +460,7 @@ var Template = Module("Template", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
table: function table(title, data, indent) {
|
table: function table(title, data, indent) {
|
||||||
XML.ignoreWhitespace = false; XML.prettyPrinting = false;
|
XML.ignoreWhitespace = XML.prettyPrinting = false;
|
||||||
let table = // <e4x>
|
let table = // <e4x>
|
||||||
<table>
|
<table>
|
||||||
<tr highlight="Title" align="left">
|
<tr highlight="Title" align="left">
|
||||||
@@ -479,7 +481,7 @@ var Template = Module("Template", {
|
|||||||
|
|
||||||
tabular: function tabular(headings, style, iter) {
|
tabular: function tabular(headings, style, iter) {
|
||||||
// TODO: This might be mind-bogglingly slow. We'll see.
|
// TODO: This might be mind-bogglingly slow. We'll see.
|
||||||
XML.ignoreWhitespace = false; XML.prettyPrinting = false;
|
XML.ignoreWhitespace = XML.prettyPrinting = false;
|
||||||
// <e4x>
|
// <e4x>
|
||||||
return <table>
|
return <table>
|
||||||
<tr highlight="Title" align="left">
|
<tr highlight="Title" align="left">
|
||||||
@@ -502,7 +504,7 @@ var Template = Module("Template", {
|
|||||||
},
|
},
|
||||||
|
|
||||||
usage: function usage(iter, format) {
|
usage: function usage(iter, format) {
|
||||||
XML.ignoreWhitespace = false; XML.prettyPrinting = false;
|
XML.ignoreWhitespace = XML.prettyPrinting = false;
|
||||||
format = format || {};
|
format = format || {};
|
||||||
let desc = format.description || function (item) template.linkifyHelp(item.description);
|
let desc = format.description || function (item) template.linkifyHelp(item.description);
|
||||||
let help = format.help || function (item) item.name;
|
let help = format.help || function (item) item.name;
|
||||||
|
|||||||
@@ -627,10 +627,10 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
|
|||||||
*/
|
*/
|
||||||
formatSeconds: function formatSeconds(seconds) {
|
formatSeconds: function formatSeconds(seconds) {
|
||||||
function pad(n, val) ("0000000" + val).substr(-Math.max(n, String(val).length));
|
function pad(n, val) ("0000000" + val).substr(-Math.max(n, String(val).length));
|
||||||
function div(num, denom) [Math.round(num / denom), Math.round(num % denom)];
|
function div(num, denom) [Math.floor(num / denom), Math.round(num % denom)];
|
||||||
let days, hours, minutes;
|
let days, hours, minutes;
|
||||||
|
|
||||||
[minutes, seconds] = div(seconds, 60);
|
[minutes, seconds] = div(Math.round(seconds), 60);
|
||||||
[hours, minutes] = div(minutes, 60);
|
[hours, minutes] = div(minutes, 60);
|
||||||
[days, hours] = div(hours, 24);
|
[days, hours] = div(hours, 24);
|
||||||
if (days)
|
if (days)
|
||||||
|
|||||||
Reference in New Issue
Block a user