X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=src%2FBuffer.cpp;h=3c7f1cc1e0f46c26fc9170d643cff3b50def377f;hb=b51f1f78007ecb29f50ba3cfc9ea830c857131bb;hp=0f7ecb08d77b738e4ff106cf273762ebc61edd4b;hpb=997f0621c5346bb623cf86713c4fe1be0c941104;p=features.git diff --git a/src/Buffer.cpp b/src/Buffer.cpp index 0f7ecb08d7..3c7f1cc1e0 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); @@ -1145,7 +1163,7 @@ bool Buffer::importFile(string const & format, FileName const & name, ErrorList FileName const lyx = tempFileName("Buffer_importFileXXXXXX.lyx"); Converters::RetVal const retval = - theConverters().convert(nullptr, name, lyx, name, format, "lyx", errorList); + theConverters().convert(this, name, lyx, name, format, "lyx", errorList); if (retval == Converters::SUCCESS) { bool const success = readFile(lyx) == ReadSuccess; removeTempFile(lyx); @@ -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 @@ -4935,6 +4953,10 @@ void Buffer::updateBuffer(UpdateScope scope, UpdateType utype) const { LBUFERR(!text().paragraphs().empty()); + // This can be called when loading a file, so that there be no + // open undo group. + UndoGroupHelper ugh(const_cast(this)); + // Use the master text class also for child documents Buffer const * const master = masterBuffer(); DocumentClass const & textclass = master->params().documentClass(); @@ -5158,7 +5180,10 @@ void Buffer::Impl::setLabel(ParIterator & it, UpdateType utype) const switch(layout.labeltype) { case LABEL_ITEMIZE: { par.params().labelString( - bp.user_defined_bullet(par.itemdepth).getUnicode()); + (par.itemdepth < 4) + ? bp.user_defined_bullet(par.itemdepth).getLabel() + // Display fallback for too deeply nested items + : bformat(from_ascii("[?%1$d]"), int(par.itemdepth + 1))); break; }