diff options
author | Kris Maglione <maglione.k@gmail.com> | 2010-10-05 10:32:56 -0400 |
---|---|---|
committer | Kris Maglione <maglione.k@gmail.com> | 2010-10-05 10:32:56 -0400 |
commit | 3da8b7af2a79ca7f4f64fe550c2c96398fe809e9 (patch) | |
tree | 66659b4a735c95c75452e4c6a559149347ca6203 /common/content/buffer.js | |
parent | b9bf655fa2771c1fef34a183788d605b1e587512 (diff) | |
download | pentadactyl-3da8b7af2a79ca7f4f64fe550c2c96398fe809e9.tar.gz |
Allow :write! >>nonexistent.file
--HG--
extra : rebase_source : b446ad89bdbaf38f6091b2145a4b4be687eeb24d
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"); + } }); } |