forked from qt-creator/qt-creator
First version of QML navigation.
This commit is contained in:
@@ -3242,6 +3242,10 @@ void BaseTextEditor::indentBlock(QTextDocument *, QTextBlock, QChar)
|
||||
{
|
||||
}
|
||||
|
||||
void BaseTextEditor::reformatBlock(QTextDocument *, QTextBlock)
|
||||
{
|
||||
}
|
||||
|
||||
void BaseTextEditor::indent(QTextDocument *doc, const QTextCursor &cursor, QChar typedChar)
|
||||
{
|
||||
if (cursor.hasSelection()) {
|
||||
@@ -3256,6 +3260,20 @@ void BaseTextEditor::indent(QTextDocument *doc, const QTextCursor &cursor, QChar
|
||||
}
|
||||
}
|
||||
|
||||
void BaseTextEditor::reformat(QTextDocument *doc, const QTextCursor &cursor)
|
||||
{
|
||||
if (cursor.hasSelection()) {
|
||||
QTextBlock block = doc->findBlock(qMin(cursor.selectionStart(), cursor.selectionEnd()));
|
||||
const QTextBlock end = doc->findBlock(qMax(cursor.selectionStart(), cursor.selectionEnd())).next();
|
||||
do {
|
||||
reformatBlock(doc, block);
|
||||
block = block.next();
|
||||
} while (block.isValid() && block != end);
|
||||
} else {
|
||||
reformatBlock(doc, cursor.block());
|
||||
}
|
||||
}
|
||||
|
||||
BaseTextEditor::Link BaseTextEditor::findLinkAt(const QTextCursor &, bool)
|
||||
{
|
||||
return Link();
|
||||
@@ -3987,6 +4005,14 @@ void BaseTextEditor::format()
|
||||
cursor.endEditBlock();
|
||||
}
|
||||
|
||||
void BaseTextEditor::reformat()
|
||||
{
|
||||
QTextCursor cursor = textCursor();
|
||||
cursor.beginEditBlock();
|
||||
reformat(document(), cursor);
|
||||
cursor.endEditBlock();
|
||||
}
|
||||
|
||||
void BaseTextEditor::rewrapParagraph()
|
||||
{
|
||||
const int paragraphWidth = displaySettings().m_wrapColumn;
|
||||
|
||||
Reference in New Issue
Block a user