When invoked without a selection, the HTML Wrap Selection as Link snippet doesn't select the placeholder display text. Adding a second tab stop to the command could select the placeholder display text but would add an extra tab for those accustomed to using the snippet with a selection.
Two questions:
1. is this a worthwhile change (or am I just looking for problems where none really exist)? 2. Is there a way to make the second tab-stop conditional on whether any text was selected?
Possible modification (added tab stop to the last line):
<a href="${1:` # if the clipboard contains a single line, let’s use that if [[ $(pbpaste|wc -l) -eq 0 ]] then pbpaste|sed 's/&/&/g' else echo http://site.com/ fi `}">${2:${TM_SELECTED_TEXT:Link text...}}</a>
The current last line is:
`}">${TM_SELECTED_TEXT:Link text...}</a>
On 10/6/2006, at 5:52, Joe Maller wrote:
When invoked without a selection, the HTML Wrap Selection as Link snippet doesn't select the placeholder display text [...] is this a worthwhile change
No, wrapping implies wrapping something.
- Is there a way to make the second tab-stop conditional on
whether any text was selected?
Only by changing the snippet to a command which then has Insert as Snippet as output option. This command could then test if there is a selection.
Opinion: Even though this does conflict with the name as such, I much prefer the functionality. I also changed the wrap seletion in open/close tag to match the behaviour.
Andreas
On Jun 11, 2006, at 12:22 , Allan Odgaard wrote:
On 10/6/2006, at 5:52, Joe Maller wrote:
When invoked without a selection, the HTML Wrap Selection as Link snippet doesn't select the placeholder display text [...] is this a worthwhile change
No, wrapping implies wrapping something.