Skip to content

Commit

Permalink
bugfix: crash in case of click on link to node and very long non exis…
Browse files Browse the repository at this point in the history
…tent anchor name
  • Loading branch information
giuspen committed Oct 21, 2016
1 parent 52d0a14 commit d861245
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion modules/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -4759,7 +4759,10 @@ def link_clicked(self, tag_property_value, from_wheel):
if len(vector) == 3: anchor_name = vector[2]
else: anchor_name = tag_property_value[len(vector[0]) + len(vector[1]) + 2:]
iter_anchor = self.link_seek_for_anchor(anchor_name)
if iter_anchor == None: support.dialog_warning(_("No anchor named '%s' found") % anchor_name, self.window)
if iter_anchor == None:
if len(anchor_name) > cons.MAX_TOOLTIP_LINK_CHARS:
anchor_name = anchor_name[:cons.MAX_TOOLTIP_LINK_CHARS] + "..."
support.dialog_warning(_("No anchor named '%s' found") % anchor_name, self.window)
else:
self.curr_buffer.place_cursor(iter_anchor)
self.sourceview.scroll_to_mark(self.curr_buffer.get_insert(), cons.SCROLL_MARGIN)
Expand Down

0 comments on commit d861245

Please sign in to comment.