Not signed in (Sign In)

Categories

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

    • CommentAuthormvm
    • CommentTimeNov 10th 2007
     permalink

    “mark as comment snippet”, for example, in C/C++ bundle, just erases selected lines. Intype 0.3.1.598.

    •  
      CommentAuthortstrokes
    • CommentTimeNov 11th 2007 edited
     permalink

    Hmm.. Seems to work for me. What does the “mark_as_comment.itSnippet” file look like in your installation.
    —Tstrokes

    • CommentAuthormvm
    • CommentTimeNov 12th 2007 edited
     permalink

    Mark as comment snippet in C/C++ bundle:

    { title: '// Mark as comment' key_equivalent: 'Ctrl+/' scope: 'source.c++' content: '${SELECTED_TEXT/^.+$/\/\/ $0/g}' }

    Get C source file, select one or more lines, then Bundles->C->//Mark as comment, and selected line(s) disappear. Windows XP SP2. Wrap as comment works fine.

    Edit: here is my test.cpp file. When I select whole 5 lines, or 1st, or from 2 to 5 inclusive, snippet does work. When I select 3, or 4, they disappear.

    int main() { int a, b, c; a = b + c; }

    •  
      CommentAuthortstrokes
    • CommentTimeNov 13th 2007
     permalink

    Hmm.. That also works for me.

    •  
      CommentAuthordflock
    • CommentTimeNov 14th 2007
     permalink

    Works for me too. Screenshot?

    • CommentAuthormvm
    • CommentTimeNov 14th 2007
     permalink

    Here are screenshots. If this is only my problem, then I won’t bother people anymore. Strange, I get the same behavior both at home and work computers.

    • CommentAuthorJack Legs
    • CommentTimeNov 14th 2007
     permalink
    I've got the same bug...
    In fact, the snippet delete the selected lines when the last select character is "\n"
    • CommentAuthorJack Legs
    • CommentTimeNov 14th 2007
     permalink
    And it doesn't work when nothing is selected...
    • CommentAuthormvm
    • CommentTimeNov 14th 2007 edited
     permalink

    Is it possible to include logic (is selection empty?) into this snippet? Seems that logic is hard to to implement with regexps. In fact, TextMate uses “Toggle Comment” command (ruby script), not snippet.

    •  
      CommentAuthordflock
    • CommentTimeNov 15th 2007 edited
     permalink

    Ok, I’ve reproduced the bug now.
    The key, as Jack said, is to make sure that you select the trailing \n character at the end of the selection. So, to trigger the disappearing lines you need to select like this:

    http://www.dflock.co.uk/intype/SelectionCommentError2.png

    not like this:

    http://www.dflock.co.uk/intype/SelectionCommentError1.png

  1.  permalink

    Fixed, will be available in next unstable release.