(self)
| 197 | |
| 198 | class yank_pop(YankCommand): |
| 199 | def do(self) -> None: |
| 200 | r = self.reader |
| 201 | b = r.buffer |
| 202 | if not r.kill_ring: |
| 203 | r.error("nothing to yank") |
| 204 | return |
| 205 | if not is_yank(r.last_command): |
| 206 | r.error("previous command was not a yank") |
| 207 | return |
| 208 | repl = len(r.kill_ring[-1]) |
| 209 | r.kill_ring.insert(0, r.kill_ring.pop()) |
| 210 | t = r.kill_ring[-1] |
| 211 | b[r.pos - repl : r.pos] = t |
| 212 | r.pos = r.pos - repl + len(t) |
| 213 | r.dirty = True |
| 214 | |
| 215 | |
| 216 | class interrupt(FinishCommand): |