1
0

forcefully mark buffer as saved/unsaved

This commit is contained in:
Deven Blake 2021-05-30 17:17:11 -04:00
parent 6630ad1e3f
commit 5b7fa586a0

15
it/saved.py Normal file
View File

@ -0,0 +1,15 @@
def main(buffer, command):
if len(command) > 2:
print("?")
elif len(command) == 2:
if command[1].isdigit():
buffer.saved = int(command[1])
elif command[1].lower() in {"true","false"}:
buffer.saved = command[1].lower == "true"
else:
print("?")
else:
buffer.saved = not(buffer.saved)
print("Buffer marked as %sSAVED" % ("" if buffer.saved else "NOT "))
return buffer