mirror of
https://github.com/gryf/pentadactyl-pm.git
synced 2025-12-21 02:57:59 +01:00
Add IO#File.
New review: owner: dougkearns I like this for the most part, except that it has to go to lengths to wrap the original nsIFile correctly, an that it can't be passed directly to other XPCOM components. It makes most operations on files a lot cleaner, though.
This commit is contained in:
@@ -892,16 +892,16 @@ function Editor() //{{{
|
||||
textBox.style.backgroundColor = "#bbbbbb";
|
||||
}
|
||||
|
||||
if (!io.writeFile(tmpfile, text))
|
||||
throw "Input contains characters not valid in the current " +
|
||||
"file encoding";
|
||||
if (!tmpfile.write(text))
|
||||
throw Error("Input contains characters not valid in the current " +
|
||||
"file encoding");
|
||||
|
||||
this.editFileExternally(tmpfile.path);
|
||||
|
||||
if (textBox)
|
||||
textBox.removeAttribute("readonly");
|
||||
|
||||
let val = io.readFile(tmpfile);
|
||||
let val = tmpfile.read();
|
||||
if (textBox)
|
||||
textBox.value = val;
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user