mirror of
https://gitee.com/vnotex/vnote.git
synced 2025-07-05 13:59:52 +08:00
do not indent empty lines when pressing tab
This commit is contained in:
parent
b7737aff61
commit
fc6aefc66f
@ -374,12 +374,15 @@ bool VMdEditOperations::handleKeyTab(QKeyEvent *p_event)
|
|||||||
int endBlockNum = endBlock.blockNumber();
|
int endBlockNum = endBlock.blockNumber();
|
||||||
while (true) {
|
while (true) {
|
||||||
Q_ASSERT(block.isValid());
|
Q_ASSERT(block.isValid());
|
||||||
|
if (!block.text().isEmpty()) {
|
||||||
QTextCursor blockCursor(block);
|
QTextCursor blockCursor(block);
|
||||||
blockCursor.insertText(text);
|
blockCursor.insertText(text);
|
||||||
|
}
|
||||||
|
|
||||||
if (block.blockNumber() == endBlockNum) {
|
if (block.blockNumber() == endBlockNum) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
block = block.next();
|
block = block.next();
|
||||||
}
|
}
|
||||||
cursor.endEditBlock();
|
cursor.endEditBlock();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user