summaryrefslogtreecommitdiffstats
path: root/vim
diff options
context:
space:
mode:
authorJesse Luehrs <doy@tozt.net>2017-11-04 23:43:19 -0400
committerJesse Luehrs <doy@tozt.net>2017-11-04 23:44:20 -0400
commitda3c22b298b7bd97fe3444125d96f8c8673454ff (patch)
tree81229b1d0bb4643efd66f5928cf99048f0113af3 /vim
parentf3efbbaa9ac98a86fe664f9ebb2c8899d4327d82 (diff)
downloadconf-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.vim10
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>"