X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2Fbuffer_funcs.cpp;h=85a22ebff756827a13eae8f13d79052680d48a65;hb=4db3e641ed6765e005343010cb90ee8af26f8f99;hp=073ddcb6f46f33c14d376a21cfc99eccba9be8a1;hpb=42dfd711977353e892aadbea6f531e59b0d92179;p=lyx.git diff --git a/src/buffer_funcs.cpp b/src/buffer_funcs.cpp index 073ddcb6f4..85a22ebff7 100644 --- a/src/buffer_funcs.cpp +++ b/src/buffer_funcs.cpp @@ -26,6 +26,7 @@ #include "LaTeX.h" #include "Layout.h" #include "LyX.h" +#include "LyXVC.h" #include "TextClass.h" #include "Paragraph.h" #include "ParagraphList.h" @@ -81,8 +82,10 @@ Buffer * checkAndLoadLyXFile(FileName const & filename, bool const acceptDirty) return checkBuffer; } - if (filename.exists()) { - if (!filename.isReadableFile()) { + bool const exists = filename.exists(); + bool const tryVC = exists ? false : LyXVC::fileInVC(filename); + if (exists || tryVC) { + if (exists && !filename.isReadableFile()) { docstring text = bformat(_("The file %1$s exists but is not " "readable by the current user."), from_utf8(filename.absFileName())); @@ -178,7 +181,7 @@ Buffer * loadIfNeeded(FileName const & fname) { Buffer * buffer = theBufferList().getBuffer(fname); if (!buffer) { - if (!fname.exists()) + if (!fname.exists() && !LyXVC::fileInVC(fname)) return 0; buffer = theBufferList().newBuffer(fname.absFileName());