Skip to content

Commit

Permalink
some fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
not-nef committed Jul 18, 2022
1 parent 99de984 commit bff5434
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def updatetab(file):
tabs[tabselected][2] = file.name
tabs[tabselected][3] = ""

def save(e, saveas=False):
def save(e="", saveas=False):
if tabs[tabselected][2] == "unsaved" or saveas:
file = filedialog.asksaveasfile()
if file != None: file = open(file, "w")
Expand Down Expand Up @@ -159,9 +159,11 @@ def new():
tabs[tabselected][1] = textwidget.text.get("1.0", "end")
textwidget.text.delete("1.0", "end")
tabs.append(["Untitled", "", "unsaved", "*"])
filedir.configure(text="unsaved")
tabselected = len(tabbuttons)

buildtabs()
updatetitle()
else: print("Tab limit reached")

def opentab(x):
Expand Down Expand Up @@ -296,7 +298,7 @@ def fileboxaction(*args):
action = fileboxstate.get()
filemenu.set("File")

if action == "Save": save("e")
if action == "Save": save()
elif action == "Open": openfile("e")
elif action == "Save As": save(saveas=True)
elif action == "New": new()
Expand Down

0 comments on commit bff5434

Please sign in to comment.