Vanilla 1.1.1 is a product of Lussumo. More Information: Documentation, Community Support.
I don’t know if this has already been reported but here is a bug I encounter in the current release (0.2.0.236) :
I have 2 custom PHP snippets:
Utils::debug( $variable );
– the second one is triggered by ‘privdebug’ and outputs
if ( $_SERVER['REMOTE_ADDR'] == '123.123.123.123' ) {
Utils::debug( $variable );
}
I can’t trigger the second snippet, Intype always outputs
privUtils::debug( $variable );
Otherwise, everything works very fine as I use Intype on a production development without any major issues.
The most annoying features I miss (but it appears to be just a matter of days/weeks) is the lack of Undo/Redo (planned for this week if I’m not wrong), the lack of horizontal scrollbar/word-wrapping (it’s horrible to scroll long lines with arrow keys) and search/replace function.
Anyway, I must say a big THANK YOU to the Intype team !
Oh, I see, so the problem is that “debug” trigger is launched on “privdebug” before the caret. Can you post here both snippets?
martincohen: Oh, I see, so the problem is that “debug” trigger is launched on “privdebug” before the caret. Can you post here both snippets?
That’s it Martin
Here are my two snippets
{
content: 'Utils::debug( ${1:variable} );'
title: 'Utils::debug( .. )'
scope: 'source.php'
tab_trigger: 'debug'
}
and
{
content: 'if ( $_SERVER[\'REMOTE_ADDR\'] == '123.123.123.123' ) {
Utils::debug( ${1:variable} );
}'
title: 'Private Utils::debug( .. )'
scope: 'source.php'
tab_trigger: 'privdebug'
}
Ok, I’ll try to fix today. Thanks.
Don’t know if it already has been fixed but I think that snippet should be triggered using the entire word and not the shortest string corresponding to a tab_trigger before the caret
How would you classify “entire word”?
martincohen: How would you classify “entire word”?
By “entire word” I mean the word before the caret. So I mean the sequence of characters from the caret to the first space/tab/carriage return/line feed encountered (a bit like how Intype does to find what to delete when hitting Ctrl+Backspace – it just deletes from the caret to the beginning of the word).
I guess that what Intype does in current release regarding snippets is :
1. look for a snippet triggered by the first char preceding the caret
2. if such a snippet is defined, it triggers this snippet and stops here
3. look for a snippet triggered by the 2 chars preceding the caret
4. if such a snippet is defined, it triggers this snippet and stops here
5. look for a snippet triggered by the 3 chars preceding the caret
etc…
What I suggested is that Intype work as this :
1. get the string from the caret to the first space/tab/CR/LF
2. look for a snippet triggered by this string
3. if such a snippet is defined, it triggers this snippet and stops here
Hmm, okay, I found the problem. Algorithm works okay, the problem is in your privdebug snippet. You haven’t escaped the single quotes. This is how it should look like.
{
content: 'if ( $_SERVER[''REMOTE_ADDR''] == ''123.123.123.123'' ) {
Utils::debug( ${1:variable} );
}'
title: 'Private Utils::debug( .. )'
scope: 'source.php'
tab_trigger: 'privdebug'
}
I found the errors loading the snippet in the Help / Log Window (F10).
You can find more information about escaping in strings here:
Ooops, sorry for that error :$
I should have seen it…
Furthermore, I even hadn’t escaped $_SERVER…. shame on me
1 to 10 of 10