<div>I have some more information about how the plugin works.</div><div><br></div><div><b>Some background</b></div><div>The Emmet plugin is the new name for the ZenCoding plugin. It gives some utility methods for writing HTML and CSS.</div><div><br></div><div>It lets you type a shorthand syntax and then expand it with a keyboard shortcut. It's kinda like a beefed up snippet.</div><div><br></div><div>I can type "table>tr*3>td*3" and hit ^E and it will create a table with three rows and three columns.</div><div><br></div><div>It works on selections or if the cursor is at the end of the Emmet expression.</div>
                <div><div><br></div><div><b>How it works</b></div><div>From what I can tell, when an Emmet expand action is executed, it looks at the carret position/selection and determines if the selection contains a valid expansion expression (or if the text proceeding the carret is a valid expression if there is no selection).</div><div><br></div><div>When the plugin is ready to perform the expansion, it tells TM to select the contents of the expansion expression, and calls `insertSnippetWithOptions` to replace the contents it with the expanded contents.</div><div><br></div><div><i>So, in a nutshell it needs to be able to:</i></div><div><br></div><div>* get/set the selection</div><div>* get/set the carret position</div><div>* get the contents of the editor as a string</div><div>* get the type of file being edited</div><div>* optionally get the name of the file being edited</div><div><br></div><div>I appreciate the help. Fixing this plugin would be a big win for TM2 front end web developers.</div><div><br></div><div>-Caleb</div><div><br></div></div>
                 
                <p style="color: #A0A0A8;">On Monday, January 28, 2013 at 11:35 AM, Caleb Land wrote:</p>
                <blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px;">
                    <span><div><div>
                <div>It looks like the plugin needs information about the selection in the editor.</div><div><br></div><div>It needs to be able go get the start position/end position and the contents of the selection</div><div><br></div><div>It also needs the "TM_SCOPE" so it can detect what kind of file is being edited.</div>
                <div><div><br></div><div>Thanks for the help.</div><div><br></div><div>-Caleb</div><div><br></div></div>
                  
                <p style="color: #A0A0A8;">On Sunday, January 27, 2013 at 3:54 AM, Allan Odgaard wrote:</p><blockquote type="cite"><div>
                    <span><div><div><div>On Jan 26, 2013, at 21:43, Caleb Land <<a href="mailto:caleb.land@gmail.com">caleb.land@gmail.com</a>> wrote:</div><div><br></div><blockquote type="cite"><div><div>[…] It uses the result to access:</div><div><br></div><div>TM_LINE_NUMBER</div><div>TM_LINE_INDEX</div></div></blockquote><div><br></div><div>Is all you need the position of the caret?</div><div><br></div><div>_______________________________________________</div><div>textmate-dev mailing list</div><div><a href="mailto:textmate-dev@lists.macromates.com">textmate-dev@lists.macromates.com</a></div><div><a href="http://lists.macromates.com/listinfo/textmate-dev">http://lists.macromates.com/listinfo/textmate-dev</a></div></div></div></span>
                  
                  
                  
                  
                </div></blockquote><div>
                    <br>
                </div>
            </div></div></span>
                 
                 
                 
                 
                </blockquote>
                 
                <div>
                    <br>
                </div>