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

Method selectedBlockRange

core/katvan_editor.cpp:643–659  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

641}
642
643std::tuple<QTextBlock, QTextBlock, bool> Editor::selectedBlockRange() const
644{
645 QTextCursor cursor = textCursor();
646 if (!cursor.hasSelection()) {
647 return std::make_tuple(cursor.block(), cursor.block(), false);
648 }
649
650 int selectionStart = cursor.selectionStart();
651 int selectionEnd = cursor.selectionEnd();
652 QTextBlock startBlock = document()->findBlock(selectionStart);
653 QTextBlock endBlock = document()->findBlock(selectionEnd);
654
655 bool fullFirstBlock = selectionStart == startBlock.position() &&
656 selectionEnd >= (endBlock.position() + endBlock.length() - 1);
657
658 return std::make_tuple(startBlock, endBlock, fullFirstBlock);
659}
660
661QString Editor::getIndentString(QTextCursor cursor) const
662{

Callers

nothing calls this directly

Calls 1

positionMethod · 0.80

Tested by

no test coverage detected