diff --git a/it/i.py b/it/i.py new file mode 100644 index 0000000..1fe385c --- /dev/null +++ b/it/i.py @@ -0,0 +1,22 @@ +def main(buffer, command): + if len(command) > 1: + print("?") + return buffer + + i = "" + while len(i) < 1 or i[-1] != ".\n": + try: + i += input() + "\n" + # unintuitive behavior from ed + except KeyboardInterrupt: + print("?") + return buffer + except EOFError: + break + + if buffer.dot < buffer.index: + buffer.content = i + else: + buffer.content = + buffer.dot += i.count("\n") + return buffer diff --git a/it/p.py b/it/p.py new file mode 100644 index 0000000..34a6a21 --- /dev/null +++ b/it/p.py @@ -0,0 +1,7 @@ +def main(buffer, command): + if len(command) < 1 or len(command) > 2: + + if buffer.dot < buffer.index: + buffer.content = i + buffer.dot += len(i) + return buffer