Add bounce matching for [] and {} like mg already does with () and like
authorbcallah <bcallah@openbsd.org>
Thu, 14 Aug 2014 12:22:58 +0000 (12:22 +0000)
committerbcallah <bcallah@openbsd.org>
Thu, 14 Aug 2014 12:22:58 +0000 (12:22 +0000)
Emacs does.
ok florian@

usr.bin/mg/keymap.c

index bd5cff1..8d52ada 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: keymap.c,v 1.51 2013/05/22 19:23:45 lum Exp $ */
+/*     $OpenBSD: keymap.c,v 1.52 2014/08/14 12:22:58 bcallah Exp $     */
 
 /* This file is in the public domain. */
 
@@ -388,16 +388,16 @@ static PF fund_del[] = {
 };
 
 static PF fund_cb[] = {
-       showmatch               /* )  */
+       showmatch               /* ) ] }  */
 };
 
 #ifndef        FUND_XMAPS
 #define NFUND_XMAPS    0       /* extra map sections after normal ones */
 #endif
 
-static struct KEYMAPE (6 + NFUND_XMAPS + IMAPEXT) fundmap = {
-       6 + NFUND_XMAPS,
-       6 + NFUND_XMAPS + IMAPEXT,
+static struct KEYMAPE (8 + NFUND_XMAPS + IMAPEXT) fundmap = {
+       8 + NFUND_XMAPS,
+       8 + NFUND_XMAPS + IMAPEXT,
        selfinsert,
        {
                {
@@ -415,6 +415,12 @@ static struct KEYMAPE (6 + NFUND_XMAPS + IMAPEXT) fundmap = {
                {
                        ')', ')', fund_cb, NULL
                },
+               {
+                       ']', ']', fund_cb, NULL
+               },
+               {
+                       '}', '}', fund_cb, NULL
+               },
                {
                        CCHR('?'), CCHR('?'), fund_del, NULL
                },