Skip to content

Commit

Permalink
Merge github.com:ivang/vim-autoclose
Browse files Browse the repository at this point in the history
PR Townk#67 on the upstream repo.
  • Loading branch information
somini committed Mar 13, 2016
2 parents a10512c + bb9ffff commit 9d34fd8
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions plugin/AutoClose.vim
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ endfunction

function! s:CountQuotes(char)
let l:currPos = col('.')-1
let l:line = strpart(getline('.'), 0, l:currPos)
let l:line = split(strpart(getline('.'), 0, l:currPos), '\s', 1)[-1]
let l:result = 0

if l:currPos >= 0
Expand Down Expand Up @@ -250,10 +250,10 @@ function! s:ClosePair(closer)
return a:closer
endfunction

" in case closer is identical with its opener - heuristically decide which one
" is being typed and act accordingly
" in case closer is identical with its opener
" close only the first opener in the word
function! s:OpenOrCloseTwinPair(char)
if s:CountQuotes(a:char) % 2 == 0
if s:CountQuotes(a:char) == 0
" act as opening char
return s:InsertPair(a:char)
else
Expand Down Expand Up @@ -371,7 +371,7 @@ function! s:DefineVariables()
" The buffer namespace is used internally
let defaults = {
\ 'AutoClosePairs': AutoClose#DefaultPairs(),
\ 'AutoCloseProtectedRegions': ["Comment", "String", "Character"],
\ 'AutoCloseProtectedRegions': ["Comment"],
\ 'AutoCloseSmartQuote': 1,
\ 'AutoCloseOn': 1,
\ 'AutoCloseSelectionWrapPrefix': '<LEADER>a',
Expand Down

0 comments on commit 9d34fd8

Please # to comment.