From e1a7f14f0011c6e35319249b62e1a9fa2cda850f Mon Sep 17 00:00:00 2001 From: bcallah Date: Thu, 14 Aug 2014 12:22:58 +0000 Subject: [PATCH] Add bounce matching for [] and {} like mg already does with () and like Emacs does. ok florian@ --- usr.bin/mg/keymap.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/usr.bin/mg/keymap.c b/usr.bin/mg/keymap.c index bd5cff15d4e..8d52ada1da7 100644 --- a/usr.bin/mg/keymap.c +++ b/usr.bin/mg/keymap.c @@ -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 }, -- 2.20.1