Home Download Buy Blog Forum Support

Snippet Segregation

Snippet Segregation

Postby frankstallone on Wed Oct 17, 2012 6:04 pm

I am trying to segregate my snippets without using scope, as that has at time caused me issues where things just did not show up, and instead using folder organization. So in other words I have four folders setup:

  • /CSS/
  • /HTML/
  • /JavaScript/
  • /PHP/

... in my /Users/ folder.

I have snippets for a particular thing I do in CSS, HTML, and JavaScript and intended on using the same tabTrigger knowing that each would be in their own folder and therefore only show up if the specific syntax was being used, or file open. Here is a screenshot example of what I thought would not happen @ http://grab.by/gPuO. Basically what we're seeing is that by typing 'qcmodal' I am getting a drop down with all three of my snippets even though they are in three different language folders. I changed the tabTriggers to be '-lang' at the end since 'qcmodal' [tab] outputted my CSS snippet whether I was in a .js file, .php file, or .css file.

What am I doing wrong? =)

Cheers,
Frank
frankstallone
 
Posts: 3
Joined: Wed Jul 18, 2012 2:54 pm

Re: Snippet Segregation

Postby jps on Thu Oct 18, 2012 1:13 am

You need to use the scope attribute within the snippet file to do this
jps
Site Admin
 
Posts: 3071
Joined: Wed Mar 19, 2008 12:33 pm

Re: Snippet Segregation

Postby frankstallone on Thu Oct 18, 2012 12:05 pm

Hmm, my mistake. I must have heard Jeffrey Way incorrectly on his screencast where I thought folder separation would be fine enough.

EDIT: Let me ask this then, if I have 'qcmodal' for multiple languages and I use scope in those snippets -- will that cause any issues?
frankstallone
 
Posts: 3
Joined: Wed Jul 18, 2012 2:54 pm

Re: Snippet Segregation

Postby frankstallone on Thu Oct 18, 2012 1:22 pm

Answered my own question. Yes you can use the same tabTrigger with multiple snippets if the scope is different.
frankstallone
 
Posts: 3
Joined: Wed Jul 18, 2012 2:54 pm


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 25 guests