7097: spell.py hangs on a note for tens of secods
shave off ~15s out of 40s of the hang
This commit is contained in:
parent
539c5ba028
commit
ba2766e5b2
@ -508,8 +508,8 @@ class StyledTextBuffer(UndoableBuffer):
|
|||||||
end = self.get_char_count()
|
end = self.get_char_count()
|
||||||
|
|
||||||
tagdict = {}
|
tagdict = {}
|
||||||
|
iter = self.get_iter_at_offset(start)
|
||||||
for pos in range(start, end):
|
for pos in range(start, end):
|
||||||
iter = self.get_iter_at_offset(pos)
|
|
||||||
for tag in iter.get_tags():
|
for tag in iter.get_tags():
|
||||||
name = tag.get_property('name')
|
name = tag.get_property('name')
|
||||||
if name in tagdict:
|
if name in tagdict:
|
||||||
@ -519,6 +519,7 @@ class StyledTextBuffer(UndoableBuffer):
|
|||||||
tagdict[name].append((pos, pos))
|
tagdict[name].append((pos, pos))
|
||||||
else:
|
else:
|
||||||
tagdict[name]=[(pos, pos)]
|
tagdict[name]=[(pos, pos)]
|
||||||
|
iter.forward_char()
|
||||||
return tagdict
|
return tagdict
|
||||||
|
|
||||||
def _find_tag_by_name(self, style, value):
|
def _find_tag_by_name(self, style, value):
|
||||||
@ -596,7 +597,7 @@ class StyledTextBuffer(UndoableBuffer):
|
|||||||
g_tags = self._get_tag_from_range()
|
g_tags = self._get_tag_from_range()
|
||||||
s_tags = []
|
s_tags = []
|
||||||
|
|
||||||
for g_tagname, g_ranges in list(g_tags.items()):
|
for g_tagname, g_ranges in g_tags.items():
|
||||||
if g_tagname.startswith('link'):
|
if g_tagname.startswith('link'):
|
||||||
tag = self.get_tag_table().lookup(g_tagname)
|
tag = self.get_tag_table().lookup(g_tagname)
|
||||||
s_ranges = [(start, end+1) for (start, end) in g_ranges]
|
s_ranges = [(start, end+1) for (start, end) in g_ranges]
|
||||||
|
Loading…
Reference in New Issue
Block a user