Not signed in (Sign In)

Categories

Vanilla 1.1.1 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthormeohaw
    • CommentTimeJan 8th 2007
     permalink
    There is a small bug in inserting code snippets in Intype.
    When you insert for example a html tags snippet from this point "<html" (here pressed tab) you got double left brucket...
    The best thing is to see this yourself, so i made a screencast of this small bug
    you can view it here >
    http://meohaw.com/intype/minorbug.html

    P.S.
    I love this editor even with bugs :D
    • CommentAuthorBrendonKoz
    • CommentTimeJan 8th 2007 edited
     permalink

    I had thought the same thing when I tried using PHP, but then I realized that I didn’t read the documentation provided, so luckily for me, unlike you, I didn’t post it — but I’m glad you did so hopefully someone else will notice this.

    The proper snippet to call the HTML content is simply:
    html
    The < and > will automatically be inserted for you. For php, one would type php and then TAB; the <?, newline and indentation, and then ?> will automatically be inserted for you, with the cursor being placed at the indentation.

    The HTML documentation that comes with Intype is (extremely small, but lists a lot of snippets, basically) in the Intype installation directory:
    C:\Program Files\Intype\doc
    You can also find this information from within Intype’s context menu. Anything with an icon labeled with an ‘S’ in a purple circle give the snippet text you would use to the far right.

    The debug log can be found at:
    C:\Documents and Settings\YOUR_USER_NAME\Application Data\Intype\!!DEBUG.LOG

    • CommentAuthormeohaw
    • CommentTimeJan 8th 2007
     permalink
    But i think when i unluckly type "<html" it should also work. This is my humble opinion and if i posted this bug incorectly you can boil me and eat me alive...
    • CommentAuthorBrendonKoz
    • CommentTimeJan 8th 2007 edited
     permalink

    Hmmm, needs salt. :P

    Technically, the snippet is working, but it’s been told to work with the text html, by itself. You have two options, you can try to get accustomed to simply using html, or you can alter the snippet that causes this. Open up … I’m thinking you’re using XHTML because standard HTML, I just realized, does not have a snippet identified with html. If you’re using standard HTML, I apologize. If you’re using XHTML you can edit:
    C:\Program Files\Intype\bundles\XHTML.itBundle\snippets\html_html.itSnippet
    ...to use the “tab trigger” of <html.

    ...note the less than sign before the html. Hope this helps.

    If you are using XHTML, I just played around with it a little bit, the following snippets used in order should work well for you:
    xml
    doctype
    html
    head
    title
    meta
    body

    You will have to move the cursor around with a few of these, but it should give you a straightforward, fully implemented standard HTML template.

    • CommentAuthormeohaw
    • CommentTimeJan 8th 2007
     permalink
    I had aleady done it, but thanks for help!
    I just think that common habbits should be taken into consideration. Sorry for my grumbling...
  1.  permalink

    I’m not part of the team, so no need to apologize to me. ;) I completely understand your possible frustration, but I think the whole power of snippets is to get used to a slightly different habbit to increase workflow. Snippets are supposed to reduce the typing necessary to create larger blocks of text, why add to that? Either way, as you’ve already stated, you’re more than welcome to your opinion! I just thought I was helping. Oops. :)

    •  
      CommentAuthorFrederick
    • CommentTimeJan 8th 2007
     permalink

    Is it really that common to write “<html” and then tab? I haven’t done or seen that anywhere until today; either you use the snippet or you write the tags yourself.

    • CommentAuthorVlad
    • CommentTimeJan 8th 2007 edited
     permalink

    You can edit snippets for you personal use, it’s easy!

    • CommentAuthormeohaw
    • CommentTimeJan 8th 2007
     permalink

    I saw that kind of writing styles many times Frederic… Especially with novices…
    Even saw this on some video from vtc.com (i do nor remember which was it, maybe RoR) ...
    But further discussion is pointless at this point. You showed me, my bad approch to this case! (God Bless you for that :) )

  2.  permalink

    With scripting support that will be introduced in further releases, you will be able to detect that there’s “<” char before the snippet and you can remove it prior to inserting html snippet.

  3.  permalink

    Is it possible to have multiple tab triggers for a single snippet, but still only showing one?

    For instance, I tried the following without success:
    tab_trigger: '$(html|\<html)'
    However, I’m not fairly versed in the language specifications that are allowed in the snippet files. Should I just go back to TextMate’s documentation for a reference, or is it different? Is there any place I can look as of yet?

    • CommentAuthormeohaw
    • CommentTimeJan 9th 2007
     permalink

    martincohen: With scripting support that will be introduced in further releases, you will be able to detect that there’s “<” char before the snippet and you can remove it prior to inserting html snippet.

    Nice feature :)

    And it would be good to try something like Brendon suggested, multiple tab_triggers that incorporates common mistakes and habits… Utopia :)

    • CommentAuthormartincohen
    • CommentTimeJan 16th 2007 edited
     permalink

    Yes, I was actually thinking about using regexps for tab triggers, and I’ll add it to feature list (for prototyping). But I have to solve the problem with providing a name for the tab trigger that will be shown for user in menu items. I have one idea: Leave tab_trigger as is, add new property for the snippet (for example tab_trigger_match). If the tab_trigger_match is provided, then the tab_trigger is used as description or title of the menu item. If tab_trigger_match is invalid or empty, the tab_trigger property is working as now. So for instance:

    { title: "MyItem" tab_trigger: "(<)html" tab_trigger_match: /(<)?html)/ }

    Any suggestions or objections?

    •  
      CommentAuthorFrederick
    • CommentTimeJan 16th 2007
     permalink

    But then if tab_trigger_match was invalid, the tab trigger would be “(<)html”? That’s not good, but I guess you can’t guard against invalidity everywhere… I’m all for your suggestion.

  4.  permalink

    Ok, my mistake. When tab_trigger_match is invalid, no tab trigger will be assigned to item and user will be informed about this.

    •  
      CommentAuthordflock
    • CommentTimeJan 16th 2007
     permalink

    I’m slightly confused – Martin, if is was using your snippet (above) and I typed (into a blank line)

    html and then a tab

    what could I expect to happen? What would happen if I typed:

    <html and then a tab

    ?

    • CommentAuthorjohno
    • CommentTimeJan 16th 2007
     permalink

    It’s not working yet, it’s only a suggestion. You have to read carefully.

    •  
      CommentAuthordflock
    • CommentTimeJan 16th 2007
     permalink

    Sorry if I wasn’t clear, that’s what I was asking about – in the suggested scenario, what could I expect to happen in my examples?

  5.  permalink

    Now Intype is using simple strings, that are compared against the text before the caret. My suggestion is about changing the string comparision to reg exp matching.

    Simply described: Intype now has an array of tab triggers, where each tab trigger belongs to one of the snippets. When you press tab, Intype starts to compare each one tab trigger against text before the caret. The longest found tab trigger wins and the snippet is launched.

    The same can be made for regular expressions (the tab_trigger_match property). But we will not compare strings against the text before caret, but matching the text against the regular expression. Snippet(s) with longest found match wins and will be launched.

    • CommentAuthorque
    • CommentTimeJan 16th 2007
     permalink

    martincohen
    great idea! must be implemented!

  6.  permalink

    So, when you have <html before the caret when pressing tab, it will be matched against (<)?html regular expression, that matches text “html” with optional < before it. So whether you have html or <html on the line both are matched and will be removed from document prior to execution of the snippet.

  7.  permalink

    This is just an idea and needs to be prototyped. There are troubles with matching text at the end of the string, and a possibility of more conflicts resulting in more snippets matched and displayed in the popup menu. With more power comes more responsibility.

    • CommentAuthorBrendonKoz
    • CommentTimeJan 16th 2007
     permalink

    I think the biggest problem here would be in execution time. If it adds to the execution of a snippet, I’d personally say to forget it and just continue on as-is. If there is not a reasonable delay on pattern matching with the tab trigger, then, well…we’ll see how it progresses. I think this is more of a “helpful” thing, but can easily go into the much more absurdly troublesome category as well (“With more power comes more responsibility.”).

    Either way, I don’t see this as a necessity, just a possibility.

  8.  permalink

    I think that reg exps library that we are using is very fast. RegExps are optimized for searching and therefore IMHO would be faster than dull comparision of strings.

    • CommentAuthormeohaw
    • CommentTimeJan 17th 2007
     permalink

    I think that regexp idea is really interesting if implemented the right way. But to be sure, we are talking about the Perl based Regular Expressions? Now something invented from scratch ?

    • CommentAuthorBrendonKoz
    • CommentTimeJan 17th 2007
     permalink

    I believe it’s the JavaScript implementation of regular expressions (non-posix).

  9.  permalink