[TxMt] Re: Code folding questions

Allan Odgaard mailinglist at textmate.org
Mon Aug 22 13:05:36 UTC 2016


On 22 Aug 2016, at 14:47, Fabian Zeindl wrote:

> Ok, so if I want to output a snippet to get correct indentation, but 
> in some cases, not change anything, I need to change output type to 
> discard.
>
> How can I do that in ruby?

	require "#{ENV['TM_SUPPORT_PATH']}/lib/exit_codes"
	⋮
	TextMate.exit_discard

It is possible to disable the indent of snippet output, but in the 
normal case, I assume you do want the indent, as I don’t think it is 
possible for you to figure out what the current indent is (since your 
command gets a selection that doesn’t start at first column).

We could introduce a new `exit_insert_as_snippet_without_indent` so that 
a command would be able to just temporarily disable the indent.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20160822/f7e5019c/attachment.html>


More information about the textmate mailing list