X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FBufferView.cpp;h=b8971fc98e02d0e1c3f7d4c5dba44e03d4cf3398;hb=225c1dbe55635a97b183909ea7194b8d92051378;hp=390dccfd4fa808807e6236877e333319e09b85bd;hpb=faab3618aeb78855a21251cb921de9455ec7248d;p=lyx.git diff --git a/src/BufferView.cpp b/src/BufferView.cpp index 390dccfd4f..b8971fc98e 100644 --- a/src/BufferView.cpp +++ b/src/BufferView.cpp @@ -308,8 +308,7 @@ BufferView::BufferView(Buffer & buf) d->cursor_.resetAnchor(); d->cursor_.setCurrentFont(); - if (graphics::Previews::status() != LyXRC::PREVIEW_OFF) - thePreviews().generateBufferPreviews(buffer_); + buffer_.updatePreviews(); } @@ -1540,8 +1539,14 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr) FindAndReplaceOptions opt; istringstream iss(to_utf8(cmd.argument())); iss >> opt; - if (findAdv(this, opt)) + if (findAdv(this, opt)) { dr.screenUpdate(Update::Force | Update::FitCursor); + cur.dispatched(); + dispatched = true; + } else { + cur.undispatched(); + dispatched = false; + } break; } @@ -1846,7 +1851,7 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr) icp["key"] = from_utf8(arg); if (!opt1.empty()) icp["before"] = from_utf8(opt1); - string icstr = InsetCommand::params2string("citation", icp); + string icstr = InsetCommand::params2string(icp); FuncRequest fr(LFUN_INSET_INSERT, icstr); lyx::dispatch(fr); break; @@ -1874,13 +1879,14 @@ void BufferView::dispatch(FuncRequest const & cmd, DispatchResult & dr) } default: - dispatched = false; + // OK, so try the Buffer itself... + buffer_.dispatch(cmd, dr); + dispatched = dr.dispatched(); break; } buffer_.undo().endUndoGroup(); dr.dispatched(dispatched); - return; } @@ -2512,8 +2518,8 @@ void BufferView::insertLyXFile(FileName const & fname) message(bformat(_("Inserting document %1$s..."), disp_fn)); docstring res; - Buffer buf("", false); - if (buf.loadLyXFile(filename) == Buffer::ReadSuccess) { + Buffer buf(filename.absFileName(), false); + if (buf.loadLyXFile() == Buffer::ReadSuccess) { ErrorList & el = buffer_.errorList("Parse"); // Copy the inserted document error list into the current buffer one. el = buf.errorList("Parse"); @@ -2528,7 +2534,6 @@ void BufferView::insertLyXFile(FileName const & fname) buffer_.changed(true); // emit message signal. message(bformat(res, disp_fn)); - buffer_.errors("Parse"); } @@ -2855,6 +2860,12 @@ DocIterator const & BufferView::inlineCompletionPos() const } +bool BufferView::fixInlineCompletionPos() +{ + return d->inlineCompletionPos_.fixIfBroken(); +} + + bool samePar(DocIterator const & a, DocIterator const & b) { if (a.empty() && b.empty())