File tree 3 files changed +12
-7
lines changed
Filter options
3 files changed +12
-7
lines changed
Original file line number Diff line number Diff line change @@ -276,7 +276,7 @@ def do(self) -> None:
276
276
x , y = r .pos2xy ()
277
277
new_y = y + 1
278
278
279
- if new_y > r . max_row ( ):
279
+ if r . eol () == len ( b ):
280
280
if r .historyi < len (r .history ):
281
281
r .select_item (r .historyi + 1 )
282
282
r .pos = r .eol (0 )
@@ -303,7 +303,7 @@ def do(self) -> None:
303
303
class left (MotionCommand ):
304
304
def do (self ) -> None :
305
305
r = self .reader
306
- for i in range (r .get_arg ()):
306
+ for _ in range (r .get_arg ()):
307
307
p = r .pos - 1
308
308
if p >= 0 :
309
309
r .pos = p
@@ -315,7 +315,7 @@ class right(MotionCommand):
315
315
def do (self ) -> None :
316
316
r = self .reader
317
317
b = r .buffer
318
- for i in range (r .get_arg ()):
318
+ for _ in range (r .get_arg ()):
319
319
p = r .pos + 1
320
320
if p <= len (b ):
321
321
r .pos = p
Original file line number Diff line number Diff line change 30
30
# types
31
31
Command = commands .Command
32
32
if False :
33
- from .types import Callback , SimpleContextManager , KeySpec , CommandName
33
+ from .types import KeySpec , CommandName
34
34
35
35
36
36
def prefix (wordlist : list [str ], j : int = 0 ) -> str :
@@ -258,10 +258,14 @@ def after_command(self, cmd: Command) -> None:
258
258
def calc_screen (self ) -> list [str ]:
259
259
screen = super ().calc_screen ()
260
260
if self .cmpltn_menu_vis :
261
- ly = self .lxy [1 ]
261
+ ly = self .lxy [1 ] + 1
262
262
screen [ly :ly ] = self .cmpltn_menu
263
- self .screeninfo [ly :ly ] = [(0 , [])]* len (self .cmpltn_menu )
264
- self .cxy = self .cxy [0 ], self .cxy [1 ] + len (self .cmpltn_menu )
263
+ # This is a horrible hack. If we're not in the middle
264
+ # of multiline edit, don't append to screeninfo
265
+ # since that screws up the position calculation
266
+ # in pos2xy function.
267
+ if self .pos != len (self .buffer ):
268
+ self .screeninfo [ly :ly ] = [(0 , [])]* len (self .cmpltn_menu )
265
269
return screen
266
270
267
271
def finish (self ) -> None :
Original file line number Diff line number Diff line change @@ -617,6 +617,7 @@ def test_updown_arrow_with_completion_menu(self):
617
617
events = itertools .chain (
618
618
code_to_events (code ),
619
619
[
620
+ Event (evt = "key" , data = "down" , raw = bytearray (b"\x1b OB" )),
620
621
Event (evt = 'key' , data = 'up' , raw = bytearray (b'\x1b OA' )),
621
622
Event (evt = "key" , data = "down" , raw = bytearray (b"\x1b OB" )),
622
623
],
You can’t perform that action at this time.
0 commit comments