The system can be updating the menu only to resolve a key equivalent, hence the image is not required. The document icon can be a little expensive to create because of the SCM badge. This would be noticeable when doing a folder search with hundres or thousands of results and then pressing ⌘1, here it would previously need to create all the document icons before responding to the key.
We should probably update the directory if the project’s project folder is changed, and we may also consider storing this in the session, at least if we set the directory during “New Tab” (based on current file browser selection).
When batch-opening documents we only load the selected one. Previously this meant that e.g. after session restore, using Find in Open Files would not search documents in background tabs (that had not yet been clicked).
Since we do not load documents before the user selects them, e.g. after session restore or when opening multiple documents, it makes sense to have both an isOpen and isLoaded property, the former means “is shown somewhere in the UI” and would make it appear (e.g. in file browser) with close button etc., whereas the latter means that data has been loaded from disk, and we can safely access the buffer.
This should be fixed in the FileChooser class, but that is non-trivial since we need to introduce a “dirty” flag and start the search when the window is made visible or possibly at the start of the next event loop cycle.
Setting OakTextView’s document currently has the side-effect that the caret is made visible, so incase the user scrolls the caret out of view and then e.g. closes the (modified) document, previously the caret would be made visible prior to showing the “Save Changes?” dialog.
This is only done for LRU tracking so it sort of makes sense to move this outside the document view itself (e.g. commit window and bundle editor does not require any LRU tracking).
This was disabled (by accident) during the migration to OakDocument, although we would still backup document content when project properties were changed (like active tab or window size).
The reason we require DocumentController to explicitly enable backups is that we do not want backups for bundle editor and commit window, since these (currently) are unable to restore documents, and the former is never really closed, so the backups would live forever.
A document which is loading is likely showing a modal dialog (encoding view) and calling sync_open will run a local event loop which may then lock up the UI.