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.
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.
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).
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.
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.
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.
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.
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.
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.
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.
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.
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).
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).
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`