mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 13:18:28 +00:00
Allow an unnamed buffer to be saved with the same name
The check whether fname != oldname does not work for unnamed buffers. Therefore, we check explicitly whether the Buffer that already exists with the same name isn't really the buffer we are trying to save.
This commit is contained in:
parent
d89158df2a
commit
30475664d3
@ -2286,7 +2286,8 @@ bool GuiView::renameBuffer(Buffer & b, docstring const & newname)
|
||||
// if there is already a Buffer open with this name, we do not want
|
||||
// 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) {
|
||||
if (theBufferList().exists(fname) && fname != oldname
|
||||
&& theBufferList().getBuffer(fname) != &b) {
|
||||
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"
|
||||
|
Loading…
Reference in New Issue
Block a user