| 715 | } |
| 716 | |
| 717 | QChar QCodeEditor::charUnderCursor(int offset) const |
| 718 | { |
| 719 | auto block = textCursor().blockNumber(); |
| 720 | auto index = textCursor().positionInBlock(); |
| 721 | auto text = document()->findBlockByNumber(block).text(); |
| 722 | |
| 723 | index += offset; |
| 724 | |
| 725 | if (index < 0 || index >= text.size()) |
| 726 | { |
| 727 | return {}; |
| 728 | } |
| 729 | |
| 730 | return text[index]; |
| 731 | } |
| 732 | |
| 733 | QString QCodeEditor::wordUnderCursor() const |
| 734 | { |