mirror of
https://github.com/Raimondi/delimitMate.git
synced 2025-12-06 12:44:27 +08:00
Flush buffer on scrolling.
This commit is contained in:
@@ -531,7 +531,11 @@ function! delimitMate#TestMappings() "{{{
|
|||||||
\ b:_l_delimitMate_apostrophes_list +
|
\ b:_l_delimitMate_apostrophes_list +
|
||||||
\ ['<BS>', '<S-BS>', '<Del>', '<S-Tab>', '<Esc>'] +
|
\ ['<BS>', '<S-BS>', '<Del>', '<S-Tab>', '<Esc>'] +
|
||||||
\ ['<Up>', '<Down>', '<Left>', '<Right>', '<LeftMouse>', '<RightMouse>'] +
|
\ ['<Up>', '<Down>', '<Left>', '<Right>', '<LeftMouse>', '<RightMouse>'] +
|
||||||
\ ['<Home>', '<End>', '<PageUp>', '<PageDown>', '<S-Down>', '<S-Up>', '<C-G>g']
|
\ ['<Home>', '<End>', '<PageUp>', '<PageDown>', '<S-Down>', '<S-Up>', '<C-G>g'] +
|
||||||
|
\ ['<ScrollWheelUp>', '<S-ScrollWheelUp>', '<C-ScrollWheelUp>'] +
|
||||||
|
\ ['<ScrollWheelDown>', '<S-ScrollWheelDown>', '<C-ScrollWheelDown>'] +
|
||||||
|
\ ['<ScrollWheelLeft>', '<S-ScrollWheelLeft>', '<C-ScrollWheelLeft>'] +
|
||||||
|
\ ['<ScrollWheelRight>', '<S-ScrollWheelRight>', '<C-ScrollWheelRight>']
|
||||||
let imaps = imaps + ( b:_l_delimitMate_expand_cr ? ['<CR>'] : [] )
|
let imaps = imaps + ( b:_l_delimitMate_expand_cr ? ['<CR>'] : [] )
|
||||||
let imaps = imaps + ( b:_l_delimitMate_expand_space ? ['<Space>'] : [] )
|
let imaps = imaps + ( b:_l_delimitMate_expand_space ? ['<Space>'] : [] )
|
||||||
|
|
||||||
|
|||||||
@@ -367,6 +367,16 @@ function! s:ExtraMappings() "{{{
|
|||||||
exec 'silent! imap <unique> <buffer> <'.map.'> <Plug>delimitMate'.map
|
exec 'silent! imap <unique> <buffer> <'.map.'> <Plug>delimitMate'.map
|
||||||
endif
|
endif
|
||||||
endfor
|
endfor
|
||||||
|
" Flush the char buffer on scrolling:
|
||||||
|
for map in ['ScrollWheelUp', 'S-ScrollWheelUp', 'C-ScrollWheelUp',
|
||||||
|
\ 'ScrollWheelDown', 'S-ScrollWheelDown', 'C-ScrollWheelDown',
|
||||||
|
\ 'ScrollWheelLeft', 'S-ScrollWheelLeft', 'C-ScrollWheelLeft',
|
||||||
|
\ 'ScrollWheelRight', 'S-ScrollWheelRight', 'C-ScrollWheelRight']
|
||||||
|
exec 'inoremap <silent> <Plug>delimitMate'.map.' <C-R>=<SID>Finish()<CR><'.map.'>'
|
||||||
|
if !hasmapto('<Plug>delimitMate'.map, 'i') && maparg('<'.map.'>', 'i') == ''
|
||||||
|
exec 'silent! imap <unique> <buffer> <'.map.'> <Plug>delimitMate'.map
|
||||||
|
endif
|
||||||
|
endfor
|
||||||
" Also for default MacVim movements:
|
" Also for default MacVim movements:
|
||||||
if has('gui_macvim')
|
if has('gui_macvim')
|
||||||
for [key, map] in [['D-Left','Home'], ['D-Right','End'], ['M-Left','C-Left'], ['M-Right','C-Right']]
|
for [key, map] in [['D-Left','Home'], ['D-Right','End'], ['M-Left','C-Left'], ['M-Right','C-Right']]
|
||||||
|
|||||||
Reference in New Issue
Block a user