mirror of
https://gitlab.gnome.org/GNOME/gimp.git
synced 2025-07-04 09:53:25 +00:00
plug-ins: do not cycle through Python Console history.
When you want to get back to the latest command, it is very confusing when it starts cycling from the oldest history command!
This commit is contained in:
parent
3284e9a487
commit
9588132849
1 changed files with 10 additions and 4 deletions
|
@ -115,10 +115,16 @@ class _ReadLine(object):
|
|||
elif self.ptr in self.edited:
|
||||
del self.edited[self.ptr]
|
||||
|
||||
self.ptr = self.ptr + dir
|
||||
if self.ptr >= len(self.items):
|
||||
self.ptr = 0
|
||||
elif self.ptr < 0:
|
||||
# Do not cycle. It's confusing.
|
||||
if (self.ptr == 0 and dir > 0) or self.ptr + dir >= len(self.items):
|
||||
# Position 0 is a bit weird. It's the last position, not
|
||||
# the first!
|
||||
self.ptr = 0
|
||||
elif self.ptr > 0 and dir < 0 and self.ptr + dir < 1:
|
||||
self.ptr = 1
|
||||
else:
|
||||
self.ptr = self.ptr + dir
|
||||
if self.ptr < 0:
|
||||
self.ptr = len(self.items) - 1
|
||||
|
||||
try:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue