latexdocument.cpp (texstudio-3.1.0) | : | latexdocument.cpp (texstudio-3.1.1) | ||
---|---|---|---|---|
skipping to change at line 1179 | skipping to change at line 1179 | |||
foreach (se, removedLabels) { | foreach (se, removedLabels) { | |||
removeElementWithSignal(se); | removeElementWithSignal(se); | |||
delete se; | delete se; | |||
} | } | |||
foreach (se, removedMagicComments) { | foreach (se, removedMagicComments) { | |||
removeElementWithSignal(se); | removeElementWithSignal(se); | |||
delete se; | delete se; | |||
} | } | |||
StructureEntry *newSection = nullptr; | StructureEntry *newSection = nullptr; | |||
if (!isHidden()) { | // always generate complete structure, also for hidden, as needed for global | |||
LatexStructureMergerMerge(this, lp.structureDepth(), lineNrStart, newCou | TOC | |||
nt)(flatStructure); | LatexStructureMergerMerge(this, lp.structureDepth(), lineNrStart, newCount)( | |||
flatStructure); | ||||
const QList<StructureEntry *> categories = | const QList<StructureEntry *> categories = | |||
QList<StructureEntry *>() << magicCommentList << blockList << | QList<StructureEntry *>() << magicCommentList << blockList << labelL | |||
labelList << todoList << bibTeXList; | ist << todoList << bibTeXList; | |||
for (int i = categories.size() - 1; i >= 0; i--) { | for (int i = categories.size() - 1; i >= 0; i--) { | |||
StructureEntry *cat = categories[i]; | StructureEntry *cat = categories[i]; | |||
if (cat->children.isEmpty() == (cat->parent == nullptr)) | if (cat->children.isEmpty() == (cat->parent == nullptr)) continue; | |||
continue; | if (cat->children.isEmpty()) removeElementWithSignal(cat); | |||
if (cat->children.isEmpty()) removeElementWithSignal(cat) | else insertElementWithSignal(baseStructure, 0, cat); | |||
; | } | |||
else insertElementWithSignal(baseStructure, 0, cat); | ||||
} | //update appendix change | |||
if (oldLine != mAppendixLine) { | ||||
//update appendix change | updateContext(oldLine, mAppendixLine, StructureEntry::InAppendix); | |||
if (oldLine != mAppendixLine) { | } | |||
updateContext(oldLine, mAppendixLine, StructureEntry::InA | //update end document change | |||
ppendix); | if (oldLineBeyond != mBeyondEnd) { | |||
} | updateContext(oldLineBeyond, mBeyondEnd, StructureEntry::BeyondEnd); | |||
//update end document change | } | |||
if (oldLineBeyond != mBeyondEnd) { | ||||
updateContext(oldLineBeyond, mBeyondEnd, StructureEntry:: | // rehighlight current cursor position | |||
BeyondEnd); | if (edView) { | |||
} | int i = edView->editor->cursor().lineNumber(); | |||
if (i >= 0) { | ||||
// rehighlight current cursor position | newSection = findSectionForLine(i); | |||
if (edView) { | ||||
int i = edView->editor->cursor().lineNumber(); | ||||
if (i >= 0) { | ||||
newSection = findSectionForLine(i); | ||||
} | ||||
} | ||||
}else{ | ||||
// in hidden case, just translate flatstructure to baseStructure/hier an | ||||
d ignore the rest | ||||
// this is necessary for toplevel TOC | ||||
QVector<StructureEntry *>rootVector(lp.MAX_STRUCTURE_LEVEL,baseStructure | ||||
); | ||||
foreach(StructureEntry *elem,flatStructure){ | ||||
if(elem->type==StructureEntry::SE_SECTION){ | ||||
rootVector[elem->level]->children.append(elem); | ||||
for(int i=elem->level+1;i<lp.MAX_STRUCTURE_LEVEL;i++){ | ||||
rootVector[i]=elem; | ||||
} | ||||
} | ||||
if(elem->type==StructureEntry::SE_INCLUDE){ | ||||
rootVector[lp.MAX_STRUCTURE_LEVEL-1]->children.append(elem); | ||||
} | ||||
} | } | |||
} | } | |||
emit structureUpdated(this, newSection); | emit structureUpdated(this, newSection); | |||
bool updateLtxCommands = false; | bool updateLtxCommands = false; | |||
if (!addedUsepackages.isEmpty() || !removedUsepackages.isEmpty() || !adde dUserCommands.isEmpty() || !removedUserCommands.isEmpty()) { | if (!addedUsepackages.isEmpty() || !removedUsepackages.isEmpty() || !adde dUserCommands.isEmpty() || !removedUserCommands.isEmpty()) { | |||
bool forceUpdate = !addedUserCommands.isEmpty() || !removedUserCo mmands.isEmpty(); | bool forceUpdate = !addedUserCommands.isEmpty() || !removedUserCo mmands.isEmpty(); | |||
reRunSuggested = (count > 1) && (!addedUsepackages.isEmpty() || ! removedUsepackages.isEmpty()); | reRunSuggested = (count > 1) && (!addedUsepackages.isEmpty() || ! removedUsepackages.isEmpty()); | |||
// don't patch single lines if the whole text needs to be rechecked anyw ays | // don't patch single lines if the whole text needs to be rechecked anyw ays | |||
updateLtxCommands = updateCompletionFiles(forceUpdate, false, true, reRu nSuggested); | updateLtxCommands = updateCompletionFiles(forceUpdate, false, true, reRu nSuggested); | |||
} | } | |||
if (bibTeXFilesNeedsUpdate) | if (bibTeXFilesNeedsUpdate) | |||
emit updateBibTeXFiles(); | emit updateBibTeXFiles(); | |||
End of changes. 4 change blocks. | ||||
50 lines changed or deleted | 29 lines changed or added |