Presently this can only be done by right-clicking the tab and selecting the “Sticky” option — if a tab is sticky then it will not be closed when executing any of the batch close actions (Close All Tabs, Close Other Tabs, Close Tabs to the Right, and holding option down while opening a file via file browser or file chooser).
Closes#1038.
The intent of this class was to allow ad-hoc recursive/lazy walking of a directory structure and having links only visited once.
It was however only used once, and for that task, path::entries() is sufficient.
While it’s easier to execute bundle items from a text view, it doesn’t work when saving documents that are not in the current text view.
This is an intermediate refactoring step — handling should (likely) end up in the DocumentSaveHelper class, but we need to improve dealing with command execution first, and by having the callback piggyback on the normal performBundleItem: method, we (temporarily) limit the code which use the command execution API, making refactoring easier.
These are now all prefixed with what they are obtaining variables for (scope, document, bundle, …) which makes it easier to analyze/refactor the code.
Also change document_t’s settings function to document_settings.
This belongs in main(), where it is already being set.
It might however be necessary to set it when running tests, although none of the tests seems to fail w/o this.
Saving is done asynchronously so the document might be closed while being saved. This in itself is not an issue, but the “post save” function will assume it has an open document for “marking as pristine” and executing potential “document did-save” callbacks on.
The problem with this feature is that it includes all untitled documents including e.g. the current bundle item being edited. For things like ⌘T we only want to show untitled documents from the current window.
This will reset the document’s backup path but not delete the backup on disk (which can be found via the document’s identifier).
This is useful if we wish to dispose the document but reconstruct it later (e.g. during application termination).
Removed the ability to specify wether documents should open in current window or a new window — all documents opened via this API will go through the same algorithm to find where the documents should end up (more choice is just adding confusion and complexity).
Since everything about session is now contained in the DocumentController class there is no need for invoking this from elsewhere and thus no need for the previous indirection.
Previously if the custom name was set before the display name was requested, it would not allocate an untitled counter, but if set later, it would (effectively) not release the counter already allocated.
We didn’t actually use the file itself, only its parent directory, and there are several places we want SCM info for an untitled file’s project directory, so removing the need for a file simplifies things.
Xcode does some weird stuff while saving, it renames the existing file (twice), having it end up in some staging area with a UUID as filename, and then disappear.
Previously TextMate would track these renames, now it waits up to one second for a new file to appear using the old file’s path.
There is a minor functional change in that the custom callback type uses event loop signaling that makes it safe to trigger the callback from a thread. This should however not be necessary for timers (which are all setup on the main thread).
This happens e.g. if we do ‘ls|mate’ — here we do have content which got a charset and newline mode assigned during “load”, but from the user’s POV he is saving a new file (if he saves the buffer) so should get his configured encoding.
There is also a new document_t::encoding_for_save_as_path which returns the encoding that would be used for the document, if saved at the given path. If the document was loaded from disk, it will return the encoding used during load, otherwise it will check tmProperties for which encoding should be used for the path provided. Save dialog for untitled documents will be pre-populated with the result of the above function.