From da3c22b298b7bd97fe3444125d96f8c8673454ff Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Sat, 4 Nov 2017 23:43:19 -0400 Subject: cr mappings should fire based on the closing char being next not the opening character being previous --- vim/plugin/autobrace.vim | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'vim') diff --git a/vim/plugin/autobrace.vim b/vim/plugin/autobrace.vim index 59bfc8b..366ea8a 100644 --- a/vim/plugin/autobrace.vim +++ b/vim/plugin/autobrace.vim @@ -4,9 +4,9 @@ let s:pair_chars = { \ '{': '}', \} let s:pair_cr_maps = { -\ '(': "go_up()", -\ '[': "go_up()", -\ '{': "go_up()", +\ ')': "go_up()", +\ ']': "go_up()", +\ '}': "go_up()", \} let s:pair_bs_maps = { \ '"': "maybe_remove_adjacent_char('\"')", @@ -136,6 +136,6 @@ inoremap \ ? "\=\run_bs_mapping(\prevchar())\" \ : "\" inoremap - \ has_cr_mapping(prevchar()) - \ ? "\=\run_cr_mapping(\prevchar())\" + \ has_cr_mapping(nextchar()) + \ ? "\=\run_cr_mapping(\nextchar())\" \ : "\" -- cgit v1.2.3-54-g00ecf