X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FBuffer.cpp;h=9826b51f7fd3b0bf068a8961be5bf141c878083c;hb=3bbce7f24afbb469fff5ad352778af73d57b44d8;hp=96005b92157f18b816c8dbc965d66c4faf994cc5;hpb=96e7fcd4e0c600c3dd99e901ff84ff1480167cf8;p=features.git diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 96005b9215..9826b51f7f 100644 --- a/src/Buffer.cpp +++ b/src/Buffer.cpp @@ -1110,6 +1110,24 @@ bool Buffer::readDocument(Lexer & lex) } +bool Buffer::isSyncTeXenabled() const +{ + bool enabled = params().output_sync; + + if (!enabled) + for (auto const & c : theConverters()) { + const string dest = c.to().substr(0,3); + if (dest == "dvi" || dest == "pdf") { + const string cmd = c.command(); + enabled |= cmd.find("-synctex=") != string::npos + && cmd.find("-synctex=0") == string::npos; + if (enabled) + break; + } + } + return enabled; +} + bool Buffer::importString(string const & format, docstring const & contents, ErrorList & errorList) { Format const * fmt = theFormats().getFormat(format); @@ -1812,7 +1830,7 @@ Buffer::ExportStatus Buffer::makeLaTeXFile(FileName const & fname, lyx_exit(1); } - d->texrow = move(os.texrow()); + d->texrow = std::move(os.texrow()); ofs.close(); if (ofs.fail()) { @@ -2686,7 +2704,7 @@ void Buffer::markDepClean(string const & name) } -bool Buffer::getStatus(FuncRequest const & cmd, FuncStatus & flag) +bool Buffer::getStatus(FuncRequest const & cmd, FuncStatus & flag) const { if (isInternal()) { // FIXME? if there is an Buffer LFUN that can be dispatched even