Insert and match paired characters #266

becdetat opened this Issue May 13, 2012 · 1 comment


None yet
3 participants

becdetat commented May 13, 2012

When entering some characters, the paired character should be inserted after the cursor. Then if the character is pressed again (within a matching pair) it should be ignored and the cursor moved left. This is how Sublime for example acts (and how VS tries to acts but fails....).

Paired characters:

`, (), [], {}, '', "", <>

EDIT more on this behaviour from Brian Terpstra's wishlist:

Needs to be smart enough to know when not to pair: Avoid pairing when inserting a starting element when there’s a non-whitespace character immediately to right, or when inserting a paired element at the end of a string that begins with an unclosed starting element.

Backspacing the first character of a pair immediately followed by the right character should delete both of them.

Also if there is text selected pressing a paired character should wrap the selection and move the cursor to the right of the second inserted pair character.

This comment has been minimized.

Show comment Hide comment

scottgulliver Jan 11, 2014


I'll take a stab at this one.


scottgulliver commented Jan 11, 2014

I'll take a stab at this one.

scottgulliver added a commit to scottgulliver/DownmarkerWPF that referenced this issue Jan 12, 2014

JakeGinnivan added a commit that referenced this issue Jan 16, 2014

Merge pull request #420 from scottg1989/pairedchars
#266 - Added automatic paired characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment