Skip to content

Commit

Permalink
bugfix: crash in case of very long tooltip when hovering on link
Browse files Browse the repository at this point in the history
  • Loading branch information
giuspen committed Oct 18, 2016
1 parent e27b21a commit 52d0a14
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions modules/cons.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,7 @@
GRID_SLIP_OFFSET = 3
MAIN_WIN_TO_TEXT_WIN_NORMALIZER = 50
MAX_RECENT_DOCS = 10
MAX_TOOLTIP_LINK_CHARS = 150
TABLE_DEFAULT_COL_MIN = 40
TABLE_DEFAULT_COL_MAX = 400
SCROLL_MARGIN = 0.3
Expand Down
2 changes: 2 additions & 0 deletions modules/support.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,8 @@ def sourceview_cursor_and_tooltips_handler(dad, text_view, x, y):
#print "link", dad.hovering_link_iter_offset
if dad.hovering_link_iter_offset >= 0:
text_view.get_window(gtk.TEXT_WINDOW_TEXT).set_cursor(gtk.gdk.Cursor(gtk.gdk.HAND2))
if len(tooltip) > cons.MAX_TOOLTIP_LINK_CHARS:
tooltip = tooltip[:cons.MAX_TOOLTIP_LINK_CHARS] + "..."
text_view.set_tooltip_text(tooltip)
else:
text_view.get_window(gtk.TEXT_WINDOW_TEXT).set_cursor(gtk.gdk.Cursor(gtk.gdk.XTERM))
Expand Down

0 comments on commit 52d0a14

Please sign in to comment.