Do not delete text if there is no end position
When inserting text without selection, there is no text to delete. issue11138 review371051002 (grafted from 0c84c8539ede9f66ca4976ca1c19d72d9a196e94) --HG-- branch : 6.0
This commit is contained in:
1 parent
a90ad79da1
commit
fd42736293
1 file changed
+2
-1
@@ -36,7 +36,8 @@ class CellRendererFloat(CellRendererInteger):
|
||||
end_pos = None
|
||||
if self._can_insert_text(widget, text, start_pos, end_pos):
|
||||
buffer_ = widget.get_buffer()
|
||||
buffer_.delete_text(start_pos, end_pos - start_pos)
|
||||
if end_pos:
|
||||
buffer_.delete_text(start_pos, end_pos - start_pos)
|
||||
buffer_.insert_text(start_pos, text, len(text))
|
||||
widget.set_position(widget.get_position() + len(text))
|
||||
return True
|
||||
|
||||
Reference in new issue
Block a user