From fdb965b45c3175e07c48b86ee58b3214518b5270 Mon Sep 17 00:00:00 2001 From: Vadim Lopatin Date: Thu, 22 Jan 2015 18:16:45 +0300 Subject: [PATCH] fix saving of text files --- src/dlangui/core/linestream.d | 2 +- src/dlangui/widgets/editors.d | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/dlangui/core/linestream.d b/src/dlangui/core/linestream.d index f480e0b5..ad83c253 100644 --- a/src/dlangui/core/linestream.d +++ b/src/dlangui/core/linestream.d @@ -124,7 +124,7 @@ class OutputLineStream { } protected void flush() { if (_len > 0) { - _stream.write(_buf[0.._len]); + _stream.writeExact(_buf.ptr, _len); _len = 0; } } diff --git a/src/dlangui/widgets/editors.d b/src/dlangui/widgets/editors.d index 493faa57..f46e93bc 100644 --- a/src/dlangui/widgets/editors.d +++ b/src/dlangui/widgets/editors.d @@ -1063,7 +1063,7 @@ class EditableContent { if (!filename) filename = _filename; try { - std.stream.File f = new std.stream.File(filename, FileMode.Out); + std.stream.File f = new std.stream.File(filename, FileMode.OutNew); scope(exit) { f.close(); } return save(f, filename, format); } catch (Exception e) {