Move outline generation to Tokenizer class instead

This commit is contained in:
Veronica Berglyd Olsen
2024-03-21 16:42:58 +01:00
parent 144ba66d9d
commit 5befd244e6
11 changed files with 109 additions and 87 deletions
+2 -2
View File
@@ -23,10 +23,10 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
"""
from __future__ import annotations
from collections.abc import Generator
import logging
from time import time
from collections.abc import Iterable
from PyQt5.QtGui import QTextBlock, QTextCursor, QTextDocument
from PyQt5.QtCore import QObject, pyqtSlot
@@ -114,7 +114,7 @@ class GuiTextDocument(QTextDocument):
return word, cPos, cLen, SHARED.spelling.suggestWords(word)
return "", -1, -1, []
def iterBlockByType(self, cType: int, maxCount: int = 1000) -> Generator[QTextBlock]:
def iterBlockByType(self, cType: int, maxCount: int = 1000) -> Iterable[QTextBlock]:
"""Iterate over all text blocks of a given type."""
count = 0
for i in range(self.blockCount()):