This is generally desired when the indent of a new line does not (necessarily) depend on lines above it, but where we otherwise do want indent corrections, e.g. HTML.
For example in ruby inserting ‘env⇥’, deleting the initially selected letter, and typing B or S, would insert an additional caret (it was actually inserted in the previous step, but not visible since it was overlapping the existing caret).
The API lack proper support for returning the new caret range so we are using a heuristic to figure out which of the returned ranges correspond to our caret. Ideally the API would be updated.
Previously if there was whitespace to the left and right of the caret, the entire sequence of whitespace was given as input to the command. This was not the case for TextMate 1.x so it broke the format commands in the LaTeX bundle (bold, italic, and teletype).
The output will be inserted corresponding to the subsets selected on each line.
If the output has less lines than the column selection then the additional selected lines are cleared.
If the output has more lines than the column selection then the additional output lines are dropped.
It should be safe to assume that clipboard data is valid UTF-8, but I’m seeing crashes related to creating a CFString (from buffer content) after a paste operation, so the assumption might not be valid.
When selecting multiple lines, but not including the newline on the last line of the selection, TextMate still consider it a “full line” and will insert a newline when pasting, unless pasting on an empty line.
Previously the check to see if the line was empty, would not account for a non-empty but selected line, which would effectively be empty since the selected text is deleted before pasting.
We now convert the output to a hex-dump incase it is not valid UTF-8. Ideally we would present the user with a dialog, but for now a hex-dump will do and prevents a potential crash.
Since we now run the shell code directly (via ‘/bin/sh -c «command»’) we no longer source ‘TM_SUPPORT_PATH/lib/bash_init.sh’.
I don’t think any code embedded in snippets rely on things setup by this file, but if they do, I’d prefer we update the snippets to explicitly source the file.
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.
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.
Since auto-pairing can be adjusted via user customization we disable it for both macro recording and replay. Old macros will need to be updated (but this was already the case, as 2.0 never did pairing as part of replay).
A better solution is to record each implicit action of the auto-pairing in the macro. This can however be added later without breaking existing macros, as the macro player will remain the same.
Closes#130.
Previously shifting text left/right would ignore blank lines (as noted in issue #419).
When shifting left though it does make sense to delete whitespace, especially as the same code is used to re-indent when pasting.
Fixes#810.
This will give the matched lines zero indent but without affecting the following lines.
Probably the only use-case for this is C preprocessor directives.