MCPcopy Index your code
hub / github.com/python/cpython / down

Class down

Lib/_pyrepl/commands.py:279–308  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

277
278
279class down(MotionCommand):
280 def do(self) -> None:
281 r = self.reader
282 b = r.buffer
283 for _ in range(r.get_arg()):
284 x, y = r.pos2xy()
285 new_y = y + 1
286
287 if r.eol() == len(b):
288 if r.historyi < len(r.history):
289 r.select_item(r.historyi + 1)
290 r.pos = r.eol(0)
291 return
292 r.pos = len(b)
293 r.error("end of buffer")
294 return
295
296 if (
297 x
298 > (
299 new_x := r.max_column(new_y)
300 ) # we're past the end of the previous line
301 or x == r.max_column(y)
302 and any(
303 not i.isspace() for i in r.buffer[r.bol() :]
304 ) # move between eols
305 ):
306 x = new_x
307
308 r.setpos_from_xy(x, new_y)
309
310
311class left(MotionCommand):

Callers 5

demo1Function · 0.85
mainFunction · 0.85
yinFunction · 0.85
switchupdownFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…