| 271 | } |
| 272 | |
| 273 | QString GitEditor::changeUnderCursor(const QTextCursor &c) |
| 274 | { |
| 275 | QTextCursor cursor = c; |
| 276 | // Any number is regarded as change number. |
| 277 | cursor.select(QTextCursor::WordUnderCursor); |
| 278 | if (!cursor.hasSelection()) |
| 279 | return {}; |
| 280 | const QString change = cursor.selectedText(); |
| 281 | if (d->changeNumberPattern.match(change).hasMatch()) |
| 282 | return change; |
| 283 | return {}; |
| 284 | } |
| 285 | |
| 286 | QString GitEditor::lineNumber(int blockNumber) const |
| 287 | { |
no test coverage detected