MCPcopy Create free account
hub / github.com/IgKh/katvan / documentChanged

Method documentChanged

core/katvan_editorlayout.cpp:312–334  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

310}
311
312void EditorLayout::documentChanged(int position, int charsRemoved, int charsAdded)
313{
314 if (!document()->isLayoutEnabled()) {
315 return;
316 }
317
318 QTextBlock startBlock = document()->findBlock(position);
319 QTextBlock endBlock = document()->findBlock(qMax(0, position + charsAdded + charsRemoved));
320 if (!endBlock.isValid()) {
321 endBlock = document()->lastBlock();
322 }
323
324 bool fullRelayoutNeeded = startBlock.blockNumber() == 0
325 && endBlock == document()->lastBlock()
326 && startBlock != endBlock;
327
328 if (fullRelayoutNeeded) {
329 d_fullLayoutDebounceTimer->start();
330 }
331 else {
332 doDocumentLayout(startBlock, endBlock);
333 }
334}
335
336void EditorLayout::doDocumentLayout(const QTextBlock& startBlock, const QTextBlock& endBlock)
337{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected