This can be used to force a file to open in a new window, e.g.:
TM_PROJECT_UUID=$(uuidgen) mate README.md
Likewise, it can be used to force multiple invocations of mate to use the initially opened window (by re-using the UUID).
Closes#879
This would happen if last line was not newline terminated.
The fix does not take into consideration that last line might contain non-ASCII, in which case it should be highlighted.
Some valid UTF-8 byte sequences are not valid code points, so our “simple” validation is no guarantee that creating an NSString from the data will succeed.
These normally require that the sender is an NSIndexSet or has one as its represented object, but with this commit, they will also be usable when there is no index set available, and will then simply use the active tab.
This is to avoid cyclic dependencies since it was previously in a somewhat high-level framework, so everything that framework depended on, could not augment crash reports.
It appears a window can hang around after its last tab has been closed. Such window receive notifications of items being deleted via the file browser, and will call the “close tabs” method in response to these, which does an out-of-range array access if no tabs exist.
The reason for why windows can hang around after last tab is closed has not yet been determined. It might be a retain cycle (bug) or a delayed release due to autorelease pools.
Fixes#1064
We now setup the indent settings when creating untitled documents where we know the folder, so that we can use potential settings scoped to that folder.
Since the document itself no longer sets this as part of regular buffer setup, we also set it when opening a document with a path, and when changing a document’s file type, although the latter is probably temporary.
Closes#305.
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.
This applies both to the action method and the settings key, the latter is now relatedFilePath to indicate that it’s a full absolute path (neither relative or a glob pattern).
This way, if we specify that ‘*.go’ has a counterpart of ‘*_test.go’ but no test file exist (and no other files with same base name) then ⌥⌘↑ will create a new tab using the test file path as default save path.
The user can now set ‘counterpart’ in .tm_properties to the absolute path of what should be used for ⌥⌘↑. If the file does not exist (on disk or as an open tab) then TextMate will fallback to searching the current folder for a file with same name.
To switch between go source and go test files one could add the following:
[ *.go ]
counterpart = "${TM_FILEPATH/(_test)?\.go$/${1:?:_test}.go/}"
Here the regular expression transformation will remove ‘_test’ from the file name if it exists, otherwise add it.
One could also do multiple settings like:
[ *.go ]
counterpart = "${TM_FILEPATH/(?=\.go$)/_test/}"
[ *_test.go ]
counterpart = "${TM_FILEPATH/_test(?=\.go$)//}"
Here ‘*.go’ files get the ‘_test’ added to their name, though files matched by the ‘*_test.go’ glob will instead have it removed.
The user may use ⇧⌘F either to bring existing results to front, or to start a new folder search for a potential different project.
If the dialog is not visible, we always initialize it fully. If already visible, we previously would not setup search folder since the current search folder might have been manually set by the user, which we do not want to overwrite.
Previously this would be selected if the user had a multi-line selection and was pressing ⌘F. The old behavior can be restored using:
defaults write findInSelectionByDefault -bool YES
This is instead of having a copy of the same code. Ideally command execution would be called after potential pre-exec stuff, but macro execution is presently handled by editor_t which doesn’t have access to the higher level stuff.
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).
Previously we relied on the delegate to set this, but a text view may not have a delegate. One could however argue that this is a “global” setting so should be set even when there is no text view.