#include "support/forkedcall.h"
#include "support/fs_extras.h"
#include "support/lyxlib.h"
#include "support/forkedcall.h"
#include "support/fs_extras.h"
#include "support/lyxlib.h"
docstring const file = makeDisplayPath(fname, 30);
docstring text = bformat(_("The document %1$s already exists.\n\n"
"Do you want to over-write that document?"), file);
docstring const file = makeDisplayPath(fname, 30);
docstring text = bformat(_("The document %1$s already exists.\n\n"
"Do you want to over-write that document?"), file);
-// Insert ascii file (if filename is empty, prompt for one)
-void insertAsciiFile(BufferView * bv, string const & f, bool asParagraph)
+// Insert plain text file (if filename is empty, prompt for one)
+void insertPlaintextFile(BufferView * bv, string const & f, bool asParagraph)
- // clear the selection
- LyXText const & text = bv->buffer()->text();
- if (&text == bv->getLyXText())
- bv->cursor().clearSelection();
+ LCursor & cur = bv->cursor();
+ cap::replaceSelection(cur);
+ recordUndo(cur);
-// Insert ascii file (if filename is empty, prompt for one)
-string getContentsOfAsciiFile(BufferView * bv, string const & f, bool asParagraph)
+// Read plain text file (if filename is empty, prompt for one)
+string getContentsOfPlaintextFile(BufferView * bv, string const & f, bool asParagraph)
FileDialog::Result result =
fileDlg.open(from_utf8(bv->buffer()->filePath()),
FileDialog::Result result =
fileDlg.open(from_utf8(bv->buffer()->filePath()),