mirror of
https://github.com/Raimondi/delimitMate.git
synced 2026-03-04 22:31:37 +08:00
Quick fixes
This commit is contained in:
@@ -48,10 +48,10 @@ let s:info.nesting = 0
|
|||||||
let s:info.typeahead = ''
|
let s:info.typeahead = ''
|
||||||
let s:info.template = {}
|
let s:info.template = {}
|
||||||
|
|
||||||
function! s:debug(debug_level, ...) "{{{
|
function! s:debug(debug_level, ...) "{{{1
|
||||||
if s:option('debug') >= a:debug_level
|
if s:option('debug') >= a:debug_level
|
||||||
let trail = expand('<sfile>')
|
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 trail = substitute(trail, '^function\s\+\%(delimitMate\)\?', '', '')
|
||||||
let message = get(a:, 1, '')
|
let message = get(a:, 1, '')
|
||||||
echom printf('%s: %s', trail, message)
|
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.n_char = strcharpart(d.ahead, 0, 1)
|
||||||
let d.around = d.p_char . d.n_char
|
let d.around = d.p_char . d.n_char
|
||||||
call extend(d, s:info.template, 'keep')
|
call extend(d, s:info.template, 'keep')
|
||||||
3DMDebug string(d)
|
"3DMDebug string(d)
|
||||||
return d
|
return d
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
@@ -170,6 +170,10 @@ function! delimitMate#option(name) "{{{1
|
|||||||
return s:option(a:name)
|
return s:option(a:name)
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
|
function! delimitMate#call(function, ...) "{{{1
|
||||||
|
return call(a:function, get(a:, 1, []))
|
||||||
|
endfunction
|
||||||
|
|
||||||
function! delimitMate#ex_cmd(global, action) "{{{1
|
function! delimitMate#ex_cmd(global, action) "{{{1
|
||||||
let scope = a:global ? g: : b:
|
let scope = a:global ? g: : b:
|
||||||
if a:action ==# 'enable'
|
if a:action ==# 'enable'
|
||||||
@@ -309,11 +313,6 @@ function! delimitMate#InsertCharPre(str) "{{{1
|
|||||||
elseif char == ' '
|
elseif char == ' '
|
||||||
3DMDebug "13"
|
3DMDebug "13"
|
||||||
let keys = s:keys4space(s:info, opts)
|
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'))
|
elseif !empty(filter(copy(opts.pairs), 'strcharpart(v:val, 0, 1) ==# char'))
|
||||||
3DMDebug "16"
|
3DMDebug "16"
|
||||||
let pair = get(filter(copy(opts.pairs), 'strcharpart(v:val, 0, 1) ==# char'), 0, '')
|
let pair = get(filter(copy(opts.pairs), 'strcharpart(v:val, 0, 1) ==# char'), 0, '')
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ call DMTest_single('abc(def)',
|
|||||||
\ ' x)'])
|
\ ' x)'])
|
||||||
|
|
||||||
" expand_cr == 2
|
" expand_cr == 2
|
||||||
let delimitMate_expand_cr = 2
|
let g:delimitMate_expand_cr = 2
|
||||||
call DMTest_single('abc(def)',
|
call DMTest_single('abc(def)',
|
||||||
\ "$i\<CR>x",
|
\ "$i\<CR>x",
|
||||||
\ ['abc(def',
|
\ ['abc(def',
|
||||||
@@ -119,7 +119,7 @@ call DMTest_quotes('', "i' x", "' x'")
|
|||||||
|
|
||||||
call DMTest_quotes('', "i'\<CR>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", "'"])
|
call DMTest_quotes('', "i'\<CR>x", ["'", "x", "'"])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user