Commit Graph

380 Commits

Author SHA1 Message Date
Allan Odgaard
af82d6e540 Update OakTabBarView to use NSDraggingSession API (10.7)
Previously used API has been deprecated.
2015-06-15 16:47:01 +02:00
Allan Odgaard
30be46a166 Support discontinuous selections in command input API 2015-03-08 14:21:59 +07:00
Allan Odgaard
0e309b1056 Add “never hide left border” tab bar view property
We set this when the file browser is on the left of the tab bar view.
2015-03-05 16:38:10 +07:00
Allan Odgaard
b80b526c70 Use actual type for OakTabBarView instead of NSView 2015-03-05 16:38:10 +07:00
Ronald Wampler
438f110dc9 fixup! Use _externalScopeAttributes as a fallback to export TM_SCM_NAME
Added a const reference to avoid the unnecessary copies when using `auto` in range-based for loops. One can find other instances in the code base where we could probably avoid making copies in similar situations, but I did not want to create the patch noise. The intention here is just to correct the obvious mistake and avoid repeating it in the future.
2015-03-05 15:34:16 +07:00
Allan Odgaard
5acabfff6b Ensure document’s metadata is up-to-date before saving it
This was a problem for the saveOnBlur which takes a shortcut to saving, and previously wouldn’t save updated metadata.

This was a problem for folded text, as the old state of folded code was saved.
2015-01-29 14:40:28 +07:00
Allan Odgaard
619125600e Replace call to cascadeTopLeftFromPoint: with custom code
The problem is that cascadeTopLeftFromPoint: will change the window frame if the window frame is outside the visible screen rect.

It would appear that the way this API is supposed to be used is that new windows should be opened using the same frame as an existing, then cascadeTopLeftFromPoint: should be called on the new window, and the result should be passed to setFrameTopLeftPoint:.

Doing it like this would complicate our code because we currently want the window frame before opening the new window, and when finding the window frame, we check whether or not we should cascade to an existing window, so we would have to pass state around with the proposed new window frame (to indicate whether or not the window should be cascaded after opening it).
2014-12-25 12:47:20 +01:00
Ronald Wampler
068ee34af8 Use _externalScopeAttributes as a fallback to export TM_SCM_NAME
We set the attribute scopes `attr.scm.*` in two different places in DocumentController; however, we only export TM_SCM_NAME if the scm variables are present. So if `scmStatus` is not enabled, TM_SCM_NAME is never set or exported, but `attr.scm.*` can still be present.
2014-12-17 15:42:25 -05:00
Ronald Wampler
26523883f3 Do not export TM_SCM_BRANCH
We original exported this for the commit window, which no longer uses it.
2014-12-17 15:42:25 -05:00
Allan Odgaard
1433432d6b Use NSApp’s activateIgnoringOtherApps: instead of SetFrontProcess
It used to be that using activateIgnoringOtherApps: would bring all windows to front, which was the motivation for using SetFrontProcessWithOptions (supplying it with the kSetFrontProcessFrontWindowOnly option), but during testing (on 10.9) it appears that activateIgnoringOtherApps: brings only main/key window to front.
2014-11-30 09:12:06 +07:00
Allan Odgaard
bf4cbd33fa Remove NSString* typecast when using to_s helper
This has a small run-time cost but source looks better and theoretically safer code.
2014-11-29 09:53:40 +07:00
Allan Odgaard
5b39bdc98b Remove double semi-colons at end of line 2014-11-14 10:21:34 +01:00
Allan Odgaard
5d2f5234af Workaround for crash when option-clicking window close button 2014-11-10 09:18:28 +01:00
Allan Odgaard
56ea12db79 Use ‘self.window’ instead of ‘_window’ for consistency
The reason we use the former is so that we can easily change our superclass to NSWindowController, though this will require 10.8 since we create weak references to our DocumentController objects.
2014-11-10 09:18:25 +01:00
Allan Odgaard
7d2ed9a236 Set initial first responder when setting up key view loop 2014-11-06 16:42:22 +01:00
Allan Odgaard
7aea556533 Remove custom NSArray category
We only use the firstObject method which has existed since OS 10.6 (though wasn’t mentioned until the 10.9 FoundationKit release notes).
2014-11-05 10:58:29 +01:00
Allan Odgaard
32d40edfcf Disallow moving window by clicking anywhere in our document view
Previously this would be allowed when clicking a non-opaque view like the OakBackgroundFillView (since 3447b88850).
2014-11-05 00:15:32 +01:00
Allan Odgaard
b581e20ad9 Add wrapper for adding views with auto layout enabled 2014-11-05 00:09:37 +01:00
Allan Odgaard
7ead6d418c Make the OakCreateLabel function more versatile 2014-11-04 22:22:57 +01:00
Allan Odgaard
137e6343ba Add convenience function to setup key view loop 2014-11-04 21:42:09 +01:00
Allan Odgaard
4bde9a99c5 Never re-use a closed HTML output window
Starting with 10.10 re-using a closed HTML output window is prone to crashing, either when opening the window with the WebView, or when later closing it.

The disadvantage of not re-using HTML output windows is only that we lose potential history, for example doing multiple documentation lookups, closing the window in between, would previously allow the user to go back in the history of words that had been looked up.
2014-11-02 12:50:43 +01:00
Allan Odgaard
2c58bb80f9 Introduce ‘disableTabAutoClose’ defaults key
This disables tabs from closing when the tab bar overflows.
2014-10-29 20:47:59 +01:00
Allan Odgaard
f2c54e0e72 Don’t restore untitled document window with no project path 2014-10-29 20:36:19 +01:00
Allan Odgaard
df1a29d7b0 Improve window restoring
Zoom or minimize windows before ordering them front, and for the latter, don’t actually order them front (as that magnifies them). Also order front windows without also setting the window as key window.
2014-10-21 09:28:52 +02:00
Allan Odgaard
e867c27926 Bring project with unsaved documents to front during save warning
If multiple projects have unsaved documents then we show an app modal dialog (not a sheet).
2014-10-20 16:01:07 +02:00
Allan Odgaard
d35ee3b9ab Saved window frame was wrong if file browser didn’t adjust width 2014-10-18 12:37:59 +02:00
Allan Odgaard
796c9856c3 Rework how we handle window frame for document windows 2014-10-16 23:05:58 +02:00
Ryan Goulden
5494f7c802 Close (empty) document when open is canceled
Implements a TODO. A close-tab is now sent to clean up documents
that failed to open properly, and a close-window is further sent
if appropriate.
2014-10-12 11:46:19 +02:00
Allan Odgaard
d9341386c7 Provide save panel with current document’s encoding settings
This is instead of the encoding settings for the initially proposed save path.
2014-10-06 20:42:42 +02:00
Allan Odgaard
26dfefc7d5 Revert "Simplify constraints used to layout document window"
This reverts commit 9a85ff2d57.

The problem with priorities (less than required) is that it allows for the constraint to not be satisfied, which could cause the document view to overlap file browser (or be cut by window’s content view) when the size available for the document view was less than its fitting size.
2014-10-05 21:51:35 +02:00
Allan Odgaard
9a85ff2d57 Simplify constraints used to layout document window
We now do the core layout with priorities that allow optional elements to insert themselves between existing elements.
2014-10-02 17:49:40 +02:00
Adam Strzelecki
b137014777 Tabs above document file browser header in tab bar
Integrate visually file manager header in tab bar when tabs above document
option in on. If tabs above document are off then use default gradient L&F.

Bottom divider for file browser header view is not integrated in header for
easier control if it is shown or not.
2014-10-02 11:03:41 +02:00
Allan Odgaard
c080a5d5d3 Use NSNegateBooleanTransformerName constant instead of string 2014-10-02 11:03:40 +02:00
Allan Odgaard
24bd3eee1d Let ProjectLayoutView setup height of file browser header 2014-09-29 13:03:45 +02:00
Allan Odgaard
b9ed2ac8ee Let ProjectLayoutView know about the file browser header view 2014-09-29 13:02:15 +02:00
Allan Odgaard
89d2450c88 Reload tabs before changing selected tab index
This worked previously because selected tab was stored using an index and we were only changing it (before reload) when closing tabs, so the new index would be valid both before and after reload.

With the new OakTabBarView the index of selected tab is instantly converted into a reference to a tab item.
2014-09-26 23:10:24 +02:00
Allan Odgaard
1f06ac9ff4 Add identifier to OakTabBarViewDataSource 2014-09-25 19:33:16 +02:00
Allan Odgaard
ee3f90366d Remember Filter Through Command output choice in user defaults 2014-09-15 17:08:22 +02:00
Allan Odgaard
7920c930c3 Use Objective-C boxing instead of stringWithUTF8String: 2014-09-13 17:09:22 +02:00
Allan Odgaard
b4956ac4fa Make ‘untitledSavePath’ a public (readonly) property 2014-09-06 14:12:31 +02:00
Allan Odgaard
542158c9f0 Inherit project folder when moving document to new window
This only happens if the document being moved is a child of the project folder.
2014-08-27 12:48:40 +02:00
Allan Odgaard
87f2c07fbc With no file browser or project folder we try document’s folder
This is for the “untitled save path” which is normally used for new untitled files, so we wouldn’t actually have a folder, however, the property is also used as a fallback for a “project folder” when that property is unset (which it generally shouldn’t be).
2014-08-22 15:54:30 +02:00
Allan Odgaard
881b83cb50 Setup project folder after saving single untitled document 2014-08-22 15:38:21 +02:00
Allan Odgaard
920777e2d6 Skip setting (complex) window title when we have no document name
Incase there is no window title settings key then we will set the window title to nil, which throws an exception.
2014-08-18 23:30:20 +02:00
Allan Odgaard
91f138c1ae Do not show non-existing locations as having been searched 2014-08-18 18:12:21 +02:00
Allan Odgaard
ffa628f328 Opening folder after session restore would not see it as open
When opening a folder we test against the ‘projectPath’ property (on already open window controllers), but this is not setup until we have an open document, and documents are opened using a background queue, so code running in the same event loop cycle as the session restore, will not get the proper value for this property.

The problem this fixes is: open /path/to/foo and quit TextMate. Now drag /path/to/foo to TextMate’s app icon. TextMate would first restore session (which includes /path/to/foo) and then open /path/to/foo (not seeing the restored folder as being /path/to/foo due to the uninitialized ‘projectPath’ property).
2014-08-15 22:37:38 +02:00
Allan Odgaard
d39ae2a7df Our grow calculation would fail to grow when given a size of one 2014-08-14 20:37:38 +02:00
Allan Odgaard
e3ca295150 Set ‘attr.test.rspec’ for projects with an ‘.rspec’ folder
This scope can be used for the Re-Run mentioned in rspec/rspec-tmbundle#90.
2014-08-08 19:42:30 +02:00
Jeremy Whitlock
f3b6c07bfb Make ⌘F default to 'Selection' for multi-line selection
Previously using ⌘F with a multiline selection would automatically set the “in”
pop-up to “Document”. This is no longer the case, but can be brought back by
running: `defaults write alwaysFindInDocument -bool YES`
2014-07-27 22:55:39 -06:00
Ronald Wampler
2dbd0d601f OakTabBarView datasource now sends the unabbreviated path 2014-06-28 17:42:22 +02:00