Not signed in (Sign In)

Categories

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

    • CommentAuthorNjke
    • CommentTimeMay 13th 2008 edited
     permalink
    First of all i want to thank the developers of that awesome eye-candy and comfortable to use project.

    Cause it is my first post, maybe, i can ask a question that already was discussed:
    How to highlight punctuation marks (if it is possible) in Intype?

    Thanks in advance!
  1.  permalink

    Well, Intype uses powerful grammar definition scheme and themes. Grammars (defined in are used to parse the text and generate a tree (output similar to HTML DOM), and with theme (defined in it applies coloring (in way similar to CSS). To help you more, can you please let us know what grammar and theme you have turned on?

  2.  permalink
    @martin: You're a bad coder, 4 brackets opened, but only 2 closed :) Syntax Error!
    • CommentAuthorNjke
    • CommentTimeMay 15th 2008
     permalink
    @martin: Yeah, i truly understand that Intype is very powerful tool, and thank you for that.
    What i want is to know how it is able (if it is) to highlight punctuation marks, like, you know, {.,()=%} and so on.
    I am using Intype to write C++ code and my currently-using theme is Espresso (slightly modified).
    Do punctuation marks belongs to some group like "Comment", "Keyboard", "Number" etc.? Or i should add them to syntaxes files?

    Thanks in advance!
    • CommentAuthorque
    • CommentTimeMay 16th 2008
     permalink

    Njke

    Do punctuation marks belongs to some group….

    They belong to punctuation group

  3.  permalink

    Njke: Well, intype does not use groups, as other editors, however, the C grammar (which is being used by C++ grammar) is a simple one. So take a look at “[Intype Install Folder]\bundles\C.itBundle\syntaxes” and you’ll find two grammars C and C++. Open C grammar and you’ll find grammar rules used for parsing the text. As Intype uses similar grammar system to TextMate, you can take a look at description of language grammars format to get the idea on how it works. You will add a set of rules that look like this:

    { match: /(\.)|(\-\>)|(==)|(=)|(\:\:)|(\,)/ name: 'keyword.operator.c' }

    This basically says: If . or -> or == or = or :: or , found, then assign it a name “keyword.operator.c”. I’ve added this example to the grammar. The position is crucial, because you want to not match the operators in strings or comments (so string and comment rules must be before the operators). Take a look here: http://intype.info/temp/C.itGrammar. Espresso now should display the operators in light blue color with bold font. That’s because it’s highlighting only keywords. You can change this, it’s in “[Intype Install Folder]themes\espresso_libre.itTheme”. Open it and try to find “keyword.operator” rule (just use Ctrl+F to find word “keyword.operator”). If found there is “JS Operator”. You can change it’s scope selector to “keyword.operator.js, keyword.operator.c” or simply remove “.js” to have it match operators everywhere. You can then change the textcolor, add background color, or set font style. Don’t forget to use command Bundles/Reload Bundles after changing the grammar. However, after changing the theme, you’ll have to close and open Intype again, the reload themes feature is not there yet.

    Let me know if this was helpful to you, and if it did the trick.

    • CommentAuthorNjke
    • CommentTimeMay 16th 2008
     permalink
    Yeap, thanks! That is really what about i've asked!
    Thanks a lot for such a fast feedback!
    And thank you for understanding my request!
    • CommentAuthorNjke
    • CommentTimeMay 17th 2008 edited
     permalink
    Am i right, that all special signs like '/', '*', '(' etc are set by preceded '\'?

    ---
    Update: OK, nevermind. I've cleared all. :)