mirror of
https://github.com/python/cpython.git
synced 2025-07-29 06:05:00 +00:00
[3.13] gh-118878: Pyrepl: show completions menu below the current line (GH-118939) (#129161)
gh-118878: Pyrepl: show completions menu below the current line (GH-118939)
(cherry picked from commit 29caec62ee
)
Co-authored-by: Daniel Hollas <daniel.hollas@bristol.ac.uk>
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
This commit is contained in:
parent
52ccf264df
commit
5c102a12a1
5 changed files with 17 additions and 9 deletions
|
@ -282,7 +282,7 @@ class down(MotionCommand):
|
|||
x, y = r.pos2xy()
|
||||
new_y = y + 1
|
||||
|
||||
if new_y > r.max_row():
|
||||
if r.eol() == len(b):
|
||||
if r.historyi < len(r.history):
|
||||
r.select_item(r.historyi + 1)
|
||||
r.pos = r.eol(0)
|
||||
|
@ -309,7 +309,7 @@ class down(MotionCommand):
|
|||
class left(MotionCommand):
|
||||
def do(self) -> None:
|
||||
r = self.reader
|
||||
for i in range(r.get_arg()):
|
||||
for _ in range(r.get_arg()):
|
||||
p = r.pos - 1
|
||||
if p >= 0:
|
||||
r.pos = p
|
||||
|
@ -321,7 +321,7 @@ class right(MotionCommand):
|
|||
def do(self) -> None:
|
||||
r = self.reader
|
||||
b = r.buffer
|
||||
for i in range(r.get_arg()):
|
||||
for _ in range(r.get_arg()):
|
||||
p = r.pos + 1
|
||||
if p <= len(b):
|
||||
r.pos = p
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue