We use to pass nil to NSMenuItem initWithTitle: when clicking the SCMFolders in
SCM Status (see commit e5841fe); however, we will *probably* never encounter
this now. But it might be useful, if custom data sources are implemented for the
file browser in the future.
The services support in the file browser was mainly added to allow Quicksilver to grab the selection, I do not recall if this is why the selection was (also) made available as a regular string (in addition to the “file names pasteboard type”).
Previously when constructing a scm URL from a path, if scm was not enabled
we returned a file URL. This could result in some unexpected behavior.
For instance, when a directory was selected in the file browser,
activating "SCM Status" would just open the untracked directory.
This patch, insteads, adds a query to the scm URL that can be parsed to
determine how to handle the scm status request later on.
This will make it easier to change the logic, since 3 different parts of the file browser depend on it: accepting first responder, selecting items, and single-clicking items.
In practice it is possible to be in a parent of the Favorites folder and expand items so that the symbolic links in favorites can be selected, this commit does not handle that case, as we would then also need to handle the case where items both inside and outside the Favorites folder were selected (at the same time).
Users who do these things are probably aware of how symbolic links work, and can use “Move to Trash”.
Closes#1089
When this setting is enabled it will render the file browser with the source list style, that is, the same style as the sidebar in Finder.
To enable run: defaults write com.macromates.TextMate.preview fileBrowserStyle SourceList
Without the ‘.png’ extension we would match the ‘Header Icons’ folder, and (recursively) copy that to our target, so the contents of the folder would exist in two places in the target (with and without the folder).
Previously each file browser would have its own array of expanded items, read from user defaults, and written back during application termination.
This meant that the last file browser to write its array, would eclipse the other file browsers.
Now we have all but the first file browser append its list of expanded items. Additionally each file browser will only append items which are actually visible.
Fixes#873.
Generally we should always provide a base environment, since the scoped variables are format strings. The filtering scope selector is however optional, and we do not have one when executing commands outside an fi;e/editor context.
Only the file browser and the ‘path_variables’ function (used for filters) made use of this method to set the working directory. Previously drop commands also used it, which is probably the only time we really need to set a working directory, as we provide the command with a relative file path.
We return a variables map instead of updating a map passed in by reference. The previous API was mainly done because we couldn’t previously return non-POD from Objective-C methods. Returning a map with variables makes the API more exact, e.g. how to handle existing entries is no longer an issue (that is, the caller will have to chose the appropriate duplicate strategy).
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.
If user was creating a new file or folder and immediately started to type in the field editor, his changes were lost during reload (which would likely happen when updating SCM badge for the newly created item).
Reload was suppressed because there is no good way to reload a table view when the field editor contains uncommitted changes. I decided it’s probably better to lose these changes than show stale content, as for example the change might remove the item being edited, as would be the case when undoing New Document or New Folder.
Closes#886.
Make available to accessibility the following information that file
browser displays visual indication for:
* file type (whether the file is a file, folder etc.)
* SCM status (whether the file is modified etc.)
* close button (whether the file is open)
Also, while we are at it, make available to accessibility the
tooltip, filename and URL.
For example a symbolic link like ~/.config (pointing to a folder) would previously get the custom icon for config files. Now it gets a folder icon (with a link badge).
We now clear the “hidden extension” flag if the user manually adds it.
We also ensure the hidden extension is not ignored by comparing base name with display name. The flag is ignored under certain circumstances.
Comparing base name with display name alone may give a false positive for localized file names.
The menu contains two (non-selectable) “actions”. If we use a pop-up, we have to change the selection after the user select one of these actions, which isn’t the case with a pull-down menu.