Quick fixes

This commit is contained in:
Israel Chauca Fuentes
2017-02-21 22:11:52 -05:00
parent 4eaeef01bf
commit 1eafd59b9c
2 changed files with 9 additions and 10 deletions

View File

@@ -48,10 +48,10 @@ let s:info.nesting = 0
let s:info.typeahead = ''
let s:info.template = {}
function! s:debug(debug_level, ...) "{{{
function! s:debug(debug_level, ...) "{{{1
if s:option('debug') >= a:debug_level
let trail = expand('<sfile>')
let trail = substitute(trail, '\.\.<SNR>\d\+_debug$', '', '')
let trail = substitute(trail, '\%(\.\.<SNR>\d\+_debug\)\+$', '', '')
let trail = substitute(trail, '^function\s\+\%(delimitMate\)\?', '', '')
let message = get(a:, 1, '')
echom printf('%s: %s', trail, message)
@@ -145,7 +145,7 @@ function! s:get_info(...) "{{{1
let d.n_char = strcharpart(d.ahead, 0, 1)
let d.around = d.p_char . d.n_char
call extend(d, s:info.template, 'keep')
3DMDebug string(d)
"3DMDebug string(d)
return d
endfunction
@@ -170,6 +170,10 @@ function! delimitMate#option(name) "{{{1
return s:option(a:name)
endfunction
function! delimitMate#call(function, ...) "{{{1
return call(a:function, get(a:, 1, []))
endfunction
function! delimitMate#ex_cmd(global, action) "{{{1
let scope = a:global ? g: : b:
if a:action ==# 'enable'
@@ -309,11 +313,6 @@ function! delimitMate#InsertCharPre(str) "{{{1
elseif char == ' '
3DMDebug "13"
let keys = s:keys4space(s:info, opts)
elseif char == "\<C-]>"
let prev_line = line('.') == 1 ? '' : getline(line('.') - 1)
let next_line = line('.') == line('$') ? '' : getline(line('.') + 1)
3DMDebug "14"
let keys = s:keys4cr(prev_line, next_line, s:info, opts)
elseif !empty(filter(copy(opts.pairs), 'strcharpart(v:val, 0, 1) ==# char'))
3DMDebug "16"
let pair = get(filter(copy(opts.pairs), 'strcharpart(v:val, 0, 1) ==# char'), 0, '')

View File

@@ -101,7 +101,7 @@ call DMTest_single('abc(def)',
\ ' x)'])
" expand_cr == 2
let delimitMate_expand_cr = 2
let g:delimitMate_expand_cr = 2
call DMTest_single('abc(def)',
\ "$i\<CR>x",
\ ['abc(def',
@@ -119,7 +119,7 @@ call DMTest_quotes('', "i' x", "' x'")
call DMTest_quotes('', "i'\<CR>x", ["'", "x'"])
let delimitMate_expand_inside_quotes = 1
let g:delimitMate_expand_inside_quotes = 1
call DMTest_quotes('', "i'\<CR>x", ["'", "x", "'"])