bug 9286; fix styledtext editing of LINK with URL as Visible element

This commit is contained in:
prculley 2016-12-17 09:54:12 -06:00 committed by Nick Hall
parent a5ed1086d8
commit 1e8ab3ec69

View File

@ -292,20 +292,18 @@ class StyledTextEditor(Gtk.TextView):
iter_at_location = iter_at_location[1] iter_at_location = iter_at_location[1]
self.match = self.textbuffer.match_check(iter_at_location.get_offset()) self.match = self.textbuffer.match_check(iter_at_location.get_offset())
tooltip = None tooltip = None
if not self.match: for tag in (tag for tag in iter_at_location.get_tags()
for tag in (tag for tag in iter_at_location.get_tags() if tag.get_property('name').startswith("link")):
if tag.get_property('name').startswith("link")): self.match = (x, y, LINK, tag.data, tag)
self.match = (x, y, LINK, tag.data, tag) tooltip = self.make_tooltip_from_link(tag)
tooltip = self.make_tooltip_from_link(tag) break
break
if self.match != self.last_match: if self.match != self.last_match:
self.emit('match-changed', self.match) self.emit('match-changed', self.match)
self.last_match = self.match self.last_match = self.match
self.get_root_window().get_pointer() # self.get_root_window().get_pointer() # Doesn't seem to do anythhing!
if tooltip: self.set_tooltip_text(tooltip)
self.set_tooltip_text(tooltip)
return False return False
def make_tooltip_from_link(self, link_tag): def make_tooltip_from_link(self, link_tag):