QCodeEdit cursor fix, replace all now signle action
This commit is contained in:
@@ -206,6 +206,7 @@ void QCodeEdit::setDocument(QTextDocument * doc) {
|
|||||||
doc->setDocumentLayout(new QPlainTextDocumentLayout(doc));
|
doc->setDocumentLayout(new QPlainTextDocumentLayout(doc));
|
||||||
ui->textCode->setDocument(doc);
|
ui->textCode->setDocument(doc);
|
||||||
cursor_width = qMax<int>(qRound(fontHeight() / 10.), 1);
|
cursor_width = qMax<int>(qRound(fontHeight() / 10.), 1);
|
||||||
|
ui->textCode->setCursorWidth(0);
|
||||||
//ui->textCode->setCursorWidth(qMax<int>(qRound(fontHeight() / 10.), 1));
|
//ui->textCode->setCursorWidth(qMax<int>(qRound(fontHeight() / 10.), 1));
|
||||||
setShowSpaces(spaces_);
|
setShowSpaces(spaces_);
|
||||||
if (doc->property("_cursor").isValid()) {
|
if (doc->property("_cursor").isValid()) {
|
||||||
@@ -1760,9 +1761,11 @@ void QCodeEdit::on_buttonReplaceSearch_clicked() {
|
|||||||
void QCodeEdit::on_buttonReplaceAll_clicked() {
|
void QCodeEdit::on_buttonReplaceAll_clicked() {
|
||||||
_replacing = true;
|
_replacing = true;
|
||||||
QString rt = ui->comboReplace->currentText();
|
QString rt = ui->comboReplace->currentText();
|
||||||
|
textCursor().beginEditBlock();
|
||||||
for (int i = es_search_list.size() - 1; i >= 0; --i)
|
for (int i = es_search_list.size() - 1; i >= 0; --i)
|
||||||
es_search_list[i].cursor.insertText(rt);
|
es_search_list[i].cursor.insertText(rt);
|
||||||
_replacing = false;
|
_replacing = false;
|
||||||
|
textCursor().endEditBlock();
|
||||||
textEdit_textChanged();
|
textEdit_textChanged();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user