| 277 | |
| 278 | |
| 279 | class 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 | |
| 311 | class left(MotionCommand): |
no outgoing calls
no test coverage detected
searching dependent graphs…