primitivus (chat): fixed crash when removing focus_marker after a :search or :history command
This commit is contained in:
parent
4ab939c46a
commit
4a0d1701fc
1 changed files with 9 additions and 4 deletions
|
|
@ -436,12 +436,17 @@ class Chat(PrimitivusWidget, quick_chat.QuickChat):
|
|||
if self.handleUserMoved(message):
|
||||
return
|
||||
|
||||
if (
|
||||
self.host.selected_widget != self or not self.host.x_notify.hasFocus()
|
||||
) and self.focus_marker_set is not None:
|
||||
if ((self.host.selected_widget != self or not self.host.x_notify.hasFocus())
|
||||
and self.focus_marker_set is not None):
|
||||
if not self.focus_marker_set and not self._locked and self.mess_walker:
|
||||
if self.focus_marker is not None:
|
||||
self.mess_walker.remove(self.focus_marker)
|
||||
try:
|
||||
self.mess_walker.remove(self.focus_marker)
|
||||
except ValueError:
|
||||
# self.focus_marker may not be in mess_walker anymore if
|
||||
# mess_walker has been cleared, e.g. when showing search
|
||||
# result or using :history command
|
||||
pass
|
||||
self.focus_marker = urwid.Divider("—")
|
||||
self.mess_walker.append(self.focus_marker)
|
||||
self.focus_marker_set = True
|
||||
|
|
|
|||
Loading…
Reference in a new issue