potentially works
This commit is contained in:
parent
212d349a8a
commit
b96038db13
21
it/src/i.py
21
it/src/i.py
@ -3,10 +3,10 @@ def main(buffer, command):
|
|||||||
print("?")
|
print("?")
|
||||||
return buffer
|
return buffer
|
||||||
|
|
||||||
i = ""
|
i = []
|
||||||
while len(i) < 1 or i[-1] != ".\n":
|
while True:
|
||||||
try:
|
try:
|
||||||
i += input() + "\n"
|
line = input()
|
||||||
# unintuitive behavior from ed
|
# unintuitive behavior from ed
|
||||||
except KeyboardInterrupt:
|
except KeyboardInterrupt:
|
||||||
print("?")
|
print("?")
|
||||||
@ -14,9 +14,18 @@ def main(buffer, command):
|
|||||||
except EOFError:
|
except EOFError:
|
||||||
break
|
break
|
||||||
|
|
||||||
|
if line == ".":
|
||||||
|
break
|
||||||
|
|
||||||
|
i.append(line)
|
||||||
|
|
||||||
if buffer.dot < buffer.index:
|
if buffer.dot < buffer.index:
|
||||||
buffer.content = i
|
buffer.content_set_list(i)
|
||||||
else:
|
else:
|
||||||
buffer.content =
|
buffer.content_set_list(
|
||||||
buffer.dot += i.count("\n")
|
buffer.content_list()[:buffer.dot]
|
||||||
|
+ i
|
||||||
|
+ buffer.content_list()[buffer.dot:]
|
||||||
|
)
|
||||||
|
buffer.dot += len(i)
|
||||||
return buffer
|
return buffer
|
||||||
|
Loading…
Reference in New Issue
Block a user