diff options
Diffstat (limited to 'common/content/buffer.js')
-rw-r--r-- | common/content/buffer.js | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/common/content/buffer.js b/common/content/buffer.js index 38e1a468..4c766f47 100644 --- a/common/content/buffer.js +++ b/common/content/buffer.js @@ -1335,10 +1335,14 @@ const Buffer = Module("buffer", { if (/^>>/.test(filename)) { 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, function (tmpFile) { - file.write(tmpFile.read(), ">>"); + try { + file.write(tmpFile.read(), ">>"); + } catch (e) { + dactyl.echoerr(file.path.quote() + ": E212: Can't open file for writing"); + } }); } |