Steve Kalkwarf wrote:

I think a clipping file with:

<CR><TAB>#INSERTION#<CR>

(where<CR>  expands to a literal return, and<TAB>  is a literal tab) would do 
the trick.

Actually, there's a small catch or two here. :)

A few months ago I tried to do what I thought would be a very simple clipping and/or script so when I pressed Ctrl-Return it would mimic hitting Return and Tab together. Dirt-simple, right?

Well, the first trick is you need #INDENT# as a placeholder somewhere. The sample you have above would not match the current indent of the text, because by default BBEdit will go back to position 0 of the next line when it inserts a clipping with a <CR> in it.

The second trick is that if you put a <TAB> in a clipping, BBEdit inserts a hard tab character, rather than checking if Auto-Expand Tabs is on and doing The Right Thing based on that. I ended up having to write a little script to insert either a hard tab or the proper number of spaces.

This is actually a somewhat long-standing pet peeve of mine with BBEdit, I confess: I'm pretty sure its authors have always coded with hard tabs, and that soft tabs were, for a very long time, treated a bit more like afterthoughts. To me, BBEdit's backspace behavior with auto-expand tabs turned on was broken until version 9.6. :) Logically, when a clipping inserts a <TAB> character, BBEdit should treat that like hitting the <TAB> key: insert either a hard tab or an appropriate run of spaces. (Or at least there should be a #TAB# placeholder which does that.)

--
Watts Martin <[email protected]>

--
You received this message because you are subscribed to the "BBEdit Talk" discussion group on Google Groups.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
<http://groups.google.com/group/bbedit?hl=en>
If you have a feature request or would like to report a problem, please email "[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.twitter.com/bbedit>

Reply via email to