Skip to content
Snippets Groups Projects
Commit e5f98848 authored by Yann Leboulanger's avatar Yann Leboulanger
Browse files

bugfix: when there is no selected text textbuffer.get_selection_bounds() return ()

parent d9377d6a
No related branches found
No related tags found
No related merge requests found
......@@ -412,12 +412,14 @@ class chat:
#we get the end of the tag
while not end_iter.ends_tag(texttag):
end_iter.forward_char()
begin_sel, end_sel = widget.get_buffer().get_selection_bounds()
if begin_sel.in_range(begin_iter, end_iter) or\
end_sel.in_range(begin_iter, end_iter):
# we have selected a text and release the button in an url, we don't
# want to open the url
return
bounds = widget.get_buffer().get_selection_bounds()
if len(bounds) == 2:
begin_sel, end_sel = bounds
if begin_sel.in_range(begin_iter, end_iter) or\
end_sel.in_range(begin_iter, end_iter):
# we have selected a text and release the button in an url, we
# don't want to open the url
return
word = begin_iter.get_text(end_iter)
if event.button == 3:
self.make_link_menu(event, kind, word)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment