Skip to content

Commit

Permalink
Theoretically finishes (please don't close the issue GH) #22
Browse files Browse the repository at this point in the history
  • Loading branch information
LunarWatcher committed Feb 20, 2021
1 parent e2013e1 commit 20dd04a
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,12 @@
# 3.0.0-beta7
`g:AutoPairsVersion = 30052`

## Fixed
* Bug in backspace triggered by empty close not being ignored ([#22](https://github.com/LunarWatcher/auto-pairs/issues/22))
* Bug in backspace triggered by a bad comparison (causing bad `<bs>` when not deleting actual pairs, but i.e. half a pair

# 3.0.0-beta6
`g:AutoPairsVersion = 30051`

## Changed
* All the keybinds ([#18](https://github.com/LunarWatcher/auto-pairs/issues/18))
Expand All @@ -7,6 +15,7 @@
* Re-disable `g:AutoPairsMultilineClose`

# 3.0.0-beta5
`g:AutoPairsVersion = 30050`

## Fixed

Expand Down
10 changes: 8 additions & 2 deletions autoload/autopairs.vim
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ scriptencoding utf-8
" Current version; not representative of tags or real versions, but purely
" meant as a number associated with the version. Semantic meaning on the first
" digit will take place. See the documentation for more details.
let g:AutoPairsVersion = 30051
let g:AutoPairsVersion = 30052

let s:save_cpo = &cpoptions
set cpoptions&vim
Expand Down Expand Up @@ -242,6 +242,8 @@ call s:define('g:AutoPairsMultibyteFastWrap', 1)

call s:define('g:AutoPairsEnableMove', 0)

call s:define('g:AutoPairsReturnOnEmptyOnly', 0)

fun! autopairs#AutoPairsScriptInit()
" This currently does nothing; see :h autopairs#AutoPairsScriptInit()
endfun
Expand Down Expand Up @@ -488,6 +490,9 @@ func! autopairs#AutoPairsDelete()

" delete the pair foo[]| <BS> to foo
for [open, close, opt] in b:AutoPairsList
if (close == '')
continue
endif
let m = s:matchend(before, '\V'.open.'\v\s*'.'\V'.close.'\v$')

if len(m) > 0
Expand All @@ -506,7 +511,7 @@ func! autopairs#AutoPairsDelete()
endif
endwhile
let a = matchstr(getline(line('.') - offset), '\V' . open . '\v\s*$') . ' '
if a != '' || b != ''
if a != ' '
return s:backspace(a) . s:backspace(b) . s:backspace(m)
endif
endif
Expand Down Expand Up @@ -770,6 +775,7 @@ func! autopairs#AutoPairsInit()
call s:define('b:AutoPairsJumpBlacklist', g:AutoPairsJumpBlacklist)
call s:define('b:AutoPairsMultilineCloseDeleteSpace', g:AutoPairsMultilineCloseDeleteSpace)
call s:define('b:AutoPairsMultibyteFastWrap', g:AutoPairsMultibyteFastWrap)
call s:define('b:AutoPairsReturnOnEmptyOnly', g:AutoPairsReturnOnEmptyOnly)

let b:autopairs_return_pos = 0
let b:autopairs_saved_pair = [0, 0]
Expand Down

0 comments on commit 20dd04a

Please sign in to comment.