| 400 | } |
| 401 | |
| 402 | void TabWidgetPrivate::onCursorRecordChanged(int pos) |
| 403 | { |
| 404 | auto editor = qobject_cast<TextEditor *>(sender()); |
| 405 | if (!editor) |
| 406 | return; |
| 407 | |
| 408 | if (curPosRecord.fileName == editor->getFile() && curPosRecord.pos == pos) |
| 409 | return; |
| 410 | |
| 411 | prePosRecord.append({ pos, editor->getFile() }); |
| 412 | for (const auto &record : nextPosRecord) { |
| 413 | prePosRecord.removeOne(record); |
| 414 | } |
| 415 | nextPosRecord.clear(); |
| 416 | if (prePosRecord.size() >= MAX_PRE_NEXT_TIMES) |
| 417 | prePosRecord.takeFirst(); |
| 418 | } |
| 419 | |
| 420 | void TabWidgetPrivate::handleDoRename(const newlsp::WorkspaceEdit &info) |
| 421 | { |