forcefully mark buffer as saved/unsaved
This commit is contained in:
parent
6630ad1e3f
commit
5b7fa586a0
15
it/saved.py
Normal file
15
it/saved.py
Normal 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
|
Loading…
Reference in New Issue
Block a user