Permalink
Browse files

setting hide tab bar preference

  • Loading branch information...
1 parent b9cdfcb commit fbd21e1fe02fc5e34a5ac2f76a31695059d0f898 @markhuot committed Jun 6, 2011
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/ProjectTree.mm
View
@@ -39,6 +39,9 @@ - (void)ProjectTree_windowDidLoad
NSArray *rootItems = [self valueForKey:@"rootItems"];
+ [[NSUserDefaults standardUserDefaults] setBool:NO forKey:@"OakProjectWindowShowTabBarEnabled"];
+ [[NSUserDefaults standardUserDefaults] synchronize];
+
/*NSDictionary *newRoot = [NSDictionary dictionaryWithObjectsAndKeys:
@"Files", @"displayName",
rootItems, @"children",

11 comments on commit fbd21e1

Will this end up as a user-editable preference? I like the idea, but it kills my Ctrl+W muscle memory since there's only one file open at a time.

Owner

markhuot replied Jun 8, 2011

Hum… I hadn't realized that's what was killing the -W shortcut. I may look for a better way to hide the tab bar then (maybe just killing the opacity or shoving it off screen…).

Actually, I commented out this commit and built the plugin again. The same thing happens, so hiding the tab bar doesn't seem to be the reason command+w breaks.

I do see that without the plugin installed, once more than one file is open, the close window shortcut shift to shift+command+w, and close tab becomes command+w. With the the plugin enabled, both shortcuts remain command+w when multiple files are open, hijacking the shortcut. Possibly there's some trigger within TM that isn't getting set?

I think I've narrowed it down to two methods: ProjectTree_tabBarView:didOpenTab and ProjectTree_tabBarView:didCloseTab (both in ProjectTree.mm). Looks like overriding the original functionality to add the newly opened files into the list removes the calls to update the shortcut bindings.

Owner

markhuot replied Jun 9, 2011

Ah! I do believe you may be correct. I'll dig in and see if there's some other way I can track tabs without overriding those methods.

Owner

markhuot replied Jun 10, 2011

Figured out how to call the native methods while still applying my own logic on top of that. Seems like Cmd+W is working much better now.

I really like to have my tab bar enabled, so I enabled it with defaults write com.macromates.textmate OakProjectWindowShowTabBarEnabled YES but everytime I open new project window, it seems like ProjectPlus overwrites that boolean value. Is there some option to make it persistent across window sessions? Maybe set it in Settings along with the option to disable "Workspace" part of the drawer (since tabs and workspace list will do the same thing).

@niksy I've submitted a pull request to add this feature in: #1

Oh, cool, hope that @markhuot will consider it and merge it with the master branch :)

Owner

markhuot replied Jun 14, 2011

@synewaves, thanks! I'll get it merged in soon (it's not applying cleanly).

Owner

markhuot replied Jun 14, 2011

Ok, all merged in, thanks for working through this with me guys.

Please sign in to comment.