From 766e8b1e3319c75bebb9811af6dc3df97d9a0119 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Tue, 26 Nov 2013 16:12:52 +0100 Subject: [PATCH] Also when not using tabs, do not open a file twice if already opened (part of #8787) --- src/frontends/qt4/GuiApplication.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/frontends/qt4/GuiApplication.cpp b/src/frontends/qt4/GuiApplication.cpp index 53fb170390..6fd3eb479f 100644 --- a/src/frontends/qt4/GuiApplication.cpp +++ b/src/frontends/qt4/GuiApplication.cpp @@ -1572,8 +1572,10 @@ void GuiApplication::dispatch(FuncRequest const & cmd, DispatchResult & dr) validateCurrentView(); // FIXME: create a new method shared with LFUN_HELP_OPEN. string const fname = to_utf8(cmd.argument()); - if (d->views_.empty() || (!lyxrc.open_buffers_in_tabs - && current_view_->documentBufferView() != 0)) { + if (d->views_.empty() + || (!lyxrc.open_buffers_in_tabs + && current_view_->documentBufferView() != 0 + && !theBufferList().getBuffer(FileName(fname)))) { // We want the ui session to be saved per document and not per // window number. The filename crc is a good enough identifier. boost::crc_32_type crc; -- 2.39.5