Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Looking through the snippet file for drupal 7 snippets, I noticed that the tab stops for the t()
are a bit wonky here.
snippet t
t('${1:/* Your text */}', array(${1:/* arguments */}), array(${2:/* options */}))
As it is, when using this snippet, the cursor is placed at the end of the line instead of the first placeholder.
The Drupal 6 version of this snippet looks fine as is.
snippet t
t('${1:/* Your text */}', array(${2:/* arguments */}))
Patch attached
Comment | File | Size | Author |
---|---|---|---|
t-func-tab-stop.patch | 422 bytes | bxtaylor |
Comments
Comment #1
bxtaylor CreditAttribution: bxtaylor commentedchanging status
Comment #2
benjifisherThanks for the patch! Reviewed and committed: 5318740.
I had trouble testing because the snippets included with the SnipMate plugin also define a snippet for
t
. How did you get around this?I have not yet decided whether to write a smallish number of snippets by hand or to generate them en masse, perhaps from the tags files. Feel free to contribute further corrections and additions, but be aware that, if performance does not suffer too much, we might end up automating the production of snippets.
Comment #3
bxtaylor CreditAttribution: bxtaylor commentedHmm I didn't have any trouble with the conflicting t snippets. In fact,
t <tab>
only brings up drupal's t function for me.I am using janus, though, and I just pulled the drupal snippets out of this project and put them into my own folders (which is how I found the typo), so I don't know if that has anything to do with it.