When we observe a change on disk we will fetch status after 0.5 seconds if we are active, otherwise 3 seconds.
If we become active and have a pending update, we update immediately.
The reason for the delay is that the change on disk could be the version control system working, for example performing a rebase, and not all systems can gracefully handle requesting status when in the midst of such operation.
Since observers of NSUserDefaultsDidChangeNotification will be called from the thread that triggered the change, we should only update user defaults from the main thread.
OakSyntaxFormatter now applies background colors only when they do not match the theme's global background color. The old behavior drew the background all the time, which looked off when drawing formatted text in the Find History list. This effect is made especially apparent by macOS 10.14's translucent combo boxes, and now that they're used for history in the Find dialog, this needed to be fixed.
This both allows updating the captures from outside the text view (e.g. Find dialog) and it uses the correct captures if performing searches in multiple tabs with delayed replacements.
Currently SCMManager is not as conservative about refreshing SCM status, specifically SCM status was previously not updated when the application was inactive, the latency for updating was pretty high (3 seconds).
We do however need to check if there are actual changes, as at least in the past, calling `hg` even when there are no changes, may cause file system to be updated, which will trigger a new status refresh.
Originally we had FSEventsManager handle directory loading because it worked as a cache, but it’s better to move this to the client, as not all clients need the directory content, additionally it simplifies the cache invalidation (reload) and also moves the hardcoded list of URL keys to preload into the client, which should know which keys are desired.
Also, switch to use the new divider styles in most places. The remaining usage of the old "OakCreateLine" functions are in the OakChooser windows. These will be refactor for better dark mode support next.
Insert and remove could still be done, but the re-ordering does not scale as we currently use an LCS algorithm that require N*M storage.
Long-term my thinking is that we can limit animated re-ordering to only include the visible rows, but my initial attempt at this showed some issues with the NSOutlineView, as re-ordering non-visible items still require a reload, which had visible side-effects.
File packages are still sorted together with regular files rather than moved to the top.
To enable, run: defaults write com.macromates.TextMate allowExpandingPackages -bool YES
For example when implicitly opening documents because we are duplicating the active document in the file browser, or closing a document because its file got deleted in the file browser, we want focus to stay in the file browser.
Previously we refocused the file browser when closing documents as a result of deleting files.
For duplicating files, this seemed to work because the file browser would not start editing the new file name until it had detected disk changes, thus it would happen after a slight delay.