Permalink
Browse files

Fixed problem with * not being removed from tab title when tab was

saved.
  • Loading branch information...
1 parent 88da900 commit 08ea8f071ea70b13e1b6086c74aa44109dcb5394 @dom96 dom96 committed Mar 23, 2013
Showing with 10 additions and 14 deletions.
  1. +10 −14 aporia.nim
View
@@ -432,21 +432,17 @@ proc onModifiedChanged(buffer: PTextBuffer, theTab: gpointer) =
# *Warning* we assume here that the currently selected tab was modified.
var ctab = cast[Tab](theTab)
#assert ((current > 0) and (current < win.tabs.len))
- var modified = ctab.buffer.getModified()
- if modified:
- var name = ""
- if cTab.filename == "":
- cTab.saved = False
- name = "Untitled *"
- else:
- cTab.saved = False
- name = extractFilename(cTab.filename) & " *"
-
- cTab.label.setText(name)
+ cTab.saved = not ctab.buffer.getModified()
+ var name = ""
+ if cTab.filename == "":
+ name = "Untitled"
else:
- cTab.saved = true
-
- setTabTooltip(cTab)
+ name = extractFilename(cTab.filename)
+ if not cTab.saved:
+ name.add(" *")
+
+ cTab.label.setText(name)
+ setTabTooltip(cTab)
proc onChanged(buffer: PTextBuffer, sv: PSourceView) =
## This function is connected to the "changed" event on `buffer`.

0 comments on commit 08ea8f0

Please sign in to comment.