Skip to content

Commit

Permalink
Enforce autopairs#Utils#escape() over escape()
Browse files Browse the repository at this point in the history
  • Loading branch information
LunarWatcher committed Jan 24, 2023
1 parent 130d9df commit 89e7529
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion autoload/autopairs.vim
Original file line number Diff line number Diff line change
Expand Up @@ -342,7 +342,7 @@ func! autopairs#AutoPairsFastWrap(...)

let match = []
let esc = substitute(close, "'", "''", "g")
let esc = escape(esc, '\')
let esc = autopairs#Utils#escape(esc, opt)

" TODO: Wtf is this for?
let res = substitute(after, '^\V' .. esc, '\=add(match, submatch(0))', '')
Expand Down
2 changes: 1 addition & 1 deletion autoload/autopairs/Insert.vim
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ fun! autopairs#Insert#checkClose(key, before, after, afterline)
" This may check multiline depending on something.
" Still not entirely sure what this brings to the table that the
" other clause doesn't
let m = matchstr(a:after, '\v^\s*\zs\V' .. escape(close, '\'))
let m = matchstr(a:after, '\v^\s*\zs\V' .. autopairs#Utils#escape(close, opt))
if m != ''
if opt['multiline']
if b:AutoPairsMultilineCloseDeleteSpace && b:autopairs_return_pos == line('.') && getline('.') =~ '\v^\s*$'
Expand Down

0 comments on commit 89e7529

Please sign in to comment.