Loading ...
Sorry, an error occurred while loading the content.

Double quotes & brackets

Expand Messages
  • layman999
    Hi, When typing certain characters, like double quotes, brackets, etc., some editors have the ability to insert the matching character and place the cursor
    Message 1 of 3 , Dec 11, 2011
    • 0 Attachment
      Hi,

      When typing certain characters, like double quotes, brackets, etc., some
      editors have the ability to insert the matching character and place the
      cursor between the two characters. (PsPad does this but it crashes too
      often on my Windows 7 x64.)

      Unless I missed it, NoteTab doesn't seem to provide this function as an
      option.

      So I thought I'd make a simple clip that gives me the option of
      inserting one of four things - Double quotes, parentheses, curly braces,
      and brackets - with the cursor placed between the two characters.

      As a single clip, each of these is very simple to do. All you have to do
      is make single clips like these:

      "^&"

      (^&)

      {^&}

      [^&]

      But I don't want four separate clips, and when I put these four little
      buggers into a simple Wizard, it doesn't work.

      The cursor ends up being placed AFTER the pair of characters instead of
      BETWEEN them. Can anybody explain why this is the case?

      The solution I came up with is to place
      ^!MoveCursor -1
      at the end of the clip, like so:

      ?{(T=L)Insert="Double quotes"^=""|(Parentheses)^=()|{Curly
      braces}^={}|[Brackets]^=[]}
      ^!MoveCursor -1

      (This is a two-line clip)

      It works and it's simple enough, but it seems like there must be a more
      elegant solution than this.
    • Sheri
      Caret-ampersand is a special notation which you don t want NoteTab to evaluate inside the clip wizard. If you substitute the special variable ^%Caret% for each
      Message 2 of 3 , Dec 11, 2011
      • 0 Attachment
        Caret-ampersand is a special notation which you don't want NoteTab to evaluate inside the clip wizard. If you substitute the special variable ^%Caret% for each caret that precedes an ampersand, it should work as you wanted.

        ^?{(T=L)Insert="Double quotes"^="^%caret%&"|(Par..etc

        Regards,
        Sheri
      • layman999
        Thanks Sheri, Another thing I noticed is that if I use ^!InsertText with the Wizard, I have to place double quotes around the double quotes, like this:
        Message 3 of 3 , Dec 12, 2011
        • 0 Attachment
          Thanks Sheri,

          Another thing I noticed is that if I use ^!InsertText with the Wizard, I
          have to place double quotes around the double quotes, like this:

          ^?{(T=L)Insert="Double quotes"^=""^%caret%&""|...

          On 12/11/2011 10:31 AM, Sheri wrote:
          >
          > Caret-ampersand is a special notation which you don't want NoteTab to
          > evaluate inside the clip wizard. If you substitute the special
          > variable ^%Caret% for each caret that precedes an ampersand, it should
          > work as you wanted.
          >
          > ^?{(T=L)Insert="Double quotes"^="^%caret%&"|(Par..etc
          >
          > Regards,
          > Sheri
          >


          [Non-text portions of this message have been removed]
        Your message has been successfully submitted and would be delivered to recipients shortly.