diff options
author | Jesse Luehrs <doy@tozt.net> | 2017-11-04 23:43:19 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2017-11-04 23:44:20 -0400 |
commit | da3c22b298b7bd97fe3444125d96f8c8673454ff (patch) | |
tree | 81229b1d0bb4643efd66f5928cf99048f0113af3 /vim | |
parent | f3efbbaa9ac98a86fe664f9ebb2c8899d4327d82 (diff) | |
download | conf-da3c22b298b7bd97fe3444125d96f8c8673454ff.tar.gz conf-da3c22b298b7bd97fe3444125d96f8c8673454ff.zip |
cr mappings should fire based on the closing char being next
not the opening character being previous
Diffstat (limited to 'vim')
-rw-r--r-- | vim/plugin/autobrace.vim | 10 |
1 files changed, 5 insertions, 5 deletions
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 = { -\ '(': "<SID>go_up()", -\ '[': "<SID>go_up()", -\ '{': "<SID>go_up()", +\ ')': "<SID>go_up()", +\ ']': "<SID>go_up()", +\ '}': "<SID>go_up()", \} let s:pair_bs_maps = { \ '"': "<SID>maybe_remove_adjacent_char('\"')", @@ -136,6 +136,6 @@ inoremap <silent><expr> <BS> \ ? "\<C-R>=\<SID>run_bs_mapping(\<SID>prevchar())\<CR>" \ : "\<BS>" inoremap <silent><expr> <CR> - \ <SID>has_cr_mapping(<SID>prevchar()) - \ ? "\<C-R>=\<SID>run_cr_mapping(\<SID>prevchar())\<CR>" + \ <SID>has_cr_mapping(<SID>nextchar()) + \ ? "\<C-R>=\<SID>run_cr_mapping(\<SID>nextchar())\<CR>" \ : "\<CR>" |