Anonymous avatar Anonymous committed 5f7baa8 Draft

Show full (relative) path to file in window title.

Comments (0)

Files changed (2)

     not expand it and ruin the 80-column width of the editor pane.
 *   Height of each label in the tab pane is smaller.
 *   Only the basename (not the directory name) of the file is displayed in
-    the label.
+    the label.  Full (relative) path to file is shown in the window title.
 *   No tooltips (they don't show up on hover for me anyway.)  Controls are
     documented in this README for now.
 ### editing ###
-*   Shift+Bkspc should delete four spaces.
+*   Shift+Bkspc should delete four spaces, or rather, do a "destructive
+    rewrite", which would just be like Tab except a different set of rules.
+*   tab with selection should not do GtkSourceView's tab with selection
 ### find and replace ###
 ### buffers ###
 *   Should not be possible to open 2 copies of the same file.
-*   Show full path to file in window title.
 *   Should be able to populate buffers from all "interesting" files in the
     current directory tree.  (repository <=> workspace)
 *   Some nice way to move/copy a buffer while inside the editor.
         self.notebook.append_page(page, vbox)
         def on_switch(widget, _, page_number):
+            self.set_window_title(page_number)
             if page_number > 0 and page_number == self.notebook.page_num(page):
         self.notebook.connect('switch-page', on_switch)
         self.window = gtk.Window()
         self.window.resize(825, 740)  # 820x745 with a little padding
-        self.window.set_title('tideay')
         def delete_event(*etc):
+            self.set_window_title(0)
         def timeout():
             for editor in self.editors.values():
             buffer.insert(start, output, len(output))
+    def set_window_title(self, page_number):
+        scrolly = self.notebook.get_nth_page(page_number)
+        editor = self.editors.get(scrolly, None)
+        if editor:
+            self.window.set_title('%s - tideay' % editor.filename)
+        else:
+            self.window.set_title('tideay')
     def prefix_edited(self, *ignore):
         if self.busy:
         where = best
         self.notebook.insert_page(scrolly, hbox, where)
-        self.notebook.set_current_page(self.notebook.page_num(scrolly))
+        page_number = self.notebook.page_num(scrolly)
+        self.notebook.set_current_page(page_number)
         self.notebook.set_tab_reorderable(scrolly, True)
         self.editors[scrolly] = editor
+        self.set_window_title(page_number)
     def active_editor(self):
         """Note that this does not return an Editor object.
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.