mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-07 08:58:38 +00:00
Fix cursor position when moving through the history
This commit is contained in:
parent
714cd0ed80
commit
1d5bc7669f
1 changed files with 3 additions and 0 deletions
|
@ -301,15 +301,18 @@ class Screen(CursesStdIO):
|
||||||
# Going back in the history
|
# Going back in the history
|
||||||
self.input_history_index -= 1
|
self.input_history_index -= 1
|
||||||
self.input = self.input_history[self.input_history_index]
|
self.input = self.input_history[self.input_history_index]
|
||||||
|
self.input_cursor = len(self.input)
|
||||||
elif c == curses.KEY_DOWN:
|
elif c == curses.KEY_DOWN:
|
||||||
if self.input_history_index + 1 < len(self.input_history):
|
if self.input_history_index + 1 < len(self.input_history):
|
||||||
# Going forward in the history
|
# Going forward in the history
|
||||||
self.input_history_index += 1
|
self.input_history_index += 1
|
||||||
self.input = self.input_history[self.input_history_index]
|
self.input = self.input_history[self.input_history_index]
|
||||||
|
self.input_cursor = len(self.input)
|
||||||
elif self.input_history_index + 1 == len(self.input_history):
|
elif self.input_history_index + 1 == len(self.input_history):
|
||||||
# We're moving back down to an incomplete input
|
# We're moving back down to an incomplete input
|
||||||
self.input_history_index += 1
|
self.input_history_index += 1
|
||||||
self.input = self.input_incomplete
|
self.input = self.input_incomplete
|
||||||
|
self.input_cursor = len(self.input)
|
||||||
|
|
||||||
# Cursor movement
|
# Cursor movement
|
||||||
elif c == curses.KEY_LEFT:
|
elif c == curses.KEY_LEFT:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue