mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 10:17:59 +01:00
Better :yank formatting.
This commit is contained in:
@@ -496,7 +496,7 @@ const Buffer = Module("buffer", {
|
||||
*/
|
||||
focusAllowed: function (elem) {
|
||||
let win = elem.ownerDocument && elem.ownerDocument.defaultView || elem;
|
||||
return !options["strictfocus"] || elem.dactylFocusAllowed;
|
||||
return !options["strictfocus"] || win.dactylFocusAllowed;
|
||||
},
|
||||
|
||||
/**
|
||||
@@ -1013,9 +1013,7 @@ const Buffer = Module("buffer", {
|
||||
// at all correctly; if somehow the view-source stuff managed to
|
||||
// execute script we'd be in big trouble here, I suspect.
|
||||
|
||||
this.docShell = Cc["@mozilla.org/docshell;1"].createInstance(Ci.nsIBaseWindow)
|
||||
.QueryInterface(Ci.nsIWebNavigation).QueryInterface(Ci.nsIWebPageDescriptor)
|
||||
.QueryInterface(Ci.nsIWebProgress);
|
||||
this.docShell = services.create("docshell");
|
||||
this.docShell.create();
|
||||
this.docShell.addProgressListener(this, this.docShell.NOTIFY_STATE_DOCUMENT);
|
||||
this.docShell.loadPage(descriptor, this.docShell.DISPLAY_AS_SOURCE);
|
||||
|
||||
@@ -1161,9 +1161,11 @@ const CommandLine = Module("commandline", {
|
||||
dactyl.registerObserver("echoLine", observe, true);
|
||||
dactyl.registerObserver("echoMultiline", observe, true);
|
||||
function observe(str, highlight, dom) {
|
||||
buffer.push(dom ? dom.textContent : str)
|
||||
if (!observe.done)
|
||||
buffer.push(dom ? util.domToString(dom) : str)
|
||||
}
|
||||
dactyl.trapErrors.apply(dactyl, [fn, self].concat(Array.slice(arguments, 2)));
|
||||
observe.done = true;
|
||||
return buffer.join("\n");
|
||||
}
|
||||
}, {
|
||||
|
||||
@@ -623,7 +623,11 @@ const Editor = Module("editor", {
|
||||
|
||||
mappings.add([modes.INSERT],
|
||||
["<Tab>"], "Expand insert mode abbreviation",
|
||||
function () { editor.expandAbbreviation(modes.INSERT); document.commandDispatcher.advanceFocus(); });
|
||||
function () {
|
||||
util.dumpStack("\n\n\n<Tab>");
|
||||
editor.expandAbbreviation(modes.INSERT);
|
||||
document.commandDispatcher.advanceFocus();
|
||||
});
|
||||
|
||||
mappings.add([modes.INSERT],
|
||||
["<C-]>", "<C-5>"], "Expand insert mode abbreviation",
|
||||
|
||||
@@ -377,7 +377,6 @@ const Hints = Module("hints", {
|
||||
* Display the hints in pageHints that are still valid.
|
||||
*/
|
||||
_showHints: function _showHints() {
|
||||
util.dumpStack();
|
||||
let hintnum = 1;
|
||||
let validHint = this._hintMatcher(this._hintString.toLowerCase());
|
||||
let activeHint = this._hintNumber || 1;
|
||||
@@ -451,7 +450,6 @@ const Hints = Module("hints", {
|
||||
* hint disappears.
|
||||
*/
|
||||
_removeHints: function _removeHints(timeout, slight) {
|
||||
util.dump("_removeHints", timeout, slight);
|
||||
for (let [,{ doc: doc, start: start, end: end }] in Iterator(this._docs)) {
|
||||
for (let elem in util.evaluateXPath("//*[@dactyl:highlight='hints']", doc))
|
||||
elem.parentNode.removeChild(elem);
|
||||
|
||||
Reference in New Issue
Block a user