mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-20 10:08:00 +01:00
Allow :write! >>nonexistent.file
--HG-- extra : rebase_source : b446ad89bdbaf38f6091b2145a4b4be687eeb24d
This commit is contained in:
@@ -1335,10 +1335,14 @@ const Buffer = Module("buffer", {
|
|||||||
|
|
||||||
if (/^>>/.test(filename)) {
|
if (/^>>/.test(filename)) {
|
||||||
let file = io.File(filename.replace(/^>>\s*/, ""));
|
let file = io.File(filename.replace(/^>>\s*/, ""));
|
||||||
dactyl.assert(file.exists() && file.isWritable(), file.path.quote() + ": E212: Can't open file for writing");
|
dactyl.assert(args.bang || file.exists() && file.isWritable(), file.path.quote() + ": E212: Can't open file for writing");
|
||||||
return buffer.viewSourceExternally(buffer.focusedFrame.document,
|
return buffer.viewSourceExternally(buffer.focusedFrame.document,
|
||||||
function (tmpFile) {
|
function (tmpFile) {
|
||||||
|
try {
|
||||||
file.write(tmpFile.read(), ">>");
|
file.write(tmpFile.read(), ">>");
|
||||||
|
} catch (e) {
|
||||||
|
dactyl.echoerr(file.path.quote() + ": E212: Can't open file for writing");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -182,8 +182,7 @@ const Tabs = Module("tabs", {
|
|||||||
TabView._initFrame();
|
TabView._initFrame();
|
||||||
let iframe = document.getElementById("tab-view");
|
let iframe = document.getElementById("tab-view");
|
||||||
this._groups = this._groups = iframe ? iframe.contentWindow : null;
|
this._groups = this._groups = iframe ? iframe.contentWindow : null;
|
||||||
if (this._groups)
|
while (this._groups && !this._groups.TabItems)
|
||||||
while (!this._groups.TabItems)
|
|
||||||
util.threadYield(false, true);
|
util.threadYield(false, true);
|
||||||
return this._groups;
|
return this._groups;
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user