the name we are trying to write in the BufferList, since the file
gets a name when it is created.
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@40489
a592a061-630c-0410-9148-
cb99ea01b6c8
// fname is now the new Buffer location.
// if there is already a Buffer open with this name, we do not want
// fname is now the new Buffer location.
// if there is already a Buffer open with this name, we do not want
- // to have another one.
- if (theBufferList().exists(fname)) {
+ // to have another one. (the second test makes sure we're not just
+ // trying to overwrite ourselves, which is fine.)
+ if (theBufferList().exists(fname) && fname != oldname) {
docstring const text =
bformat(_("The file\n%1$s\nis already open in your current session.\n"
"Please close it before attempting to overwrite it.\n"
docstring const text =
bformat(_("The file\n%1$s\nis already open in your current session.\n"
"Please close it before attempting to overwrite it.\n"