Skip to content

Commit 97bc933

Browse files
thalesmellotpope
authored andcommitted
Fix maparg check for am, im, aM and iM mappings (#299)
1 parent 2412e02 commit 97bc933

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

ftplugin/ruby.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ if !exists("g:no_plugin_maps") && !exists("g:no_ruby_maps")
184184
\."| sil! exe 'unmap <buffer> [[' | sil! exe 'unmap <buffer> ]]' | sil! exe 'unmap <buffer> []' | sil! exe 'unmap <buffer> ]['"
185185
\."| sil! exe 'unmap <buffer> [m' | sil! exe 'unmap <buffer> ]m' | sil! exe 'unmap <buffer> [M' | sil! exe 'unmap <buffer> ]M'"
186186

187-
if maparg('im','n') == ''
187+
if maparg('im','x') == '' && maparg('im','o') == '' && maparg('am','x') == '' && maparg('am','o') == ''
188188
onoremap <silent> <buffer> im :<C-U>call <SID>wrap_i('[m',']M')<CR>
189189
onoremap <silent> <buffer> am :<C-U>call <SID>wrap_a('[m',']M')<CR>
190190
xnoremap <silent> <buffer> im :<C-U>call <SID>wrap_i('[m',']M')<CR>
@@ -194,7 +194,7 @@ if !exists("g:no_plugin_maps") && !exists("g:no_ruby_maps")
194194
\."| sil! exe 'xunmap <buffer> im' | sil! exe 'xunmap <buffer> am'"
195195
endif
196196

197-
if maparg('iM','n') == ''
197+
if maparg('iM','x') == '' && maparg('iM','o') == '' && maparg('aM','x') == '' && maparg('aM','o') == ''
198198
onoremap <silent> <buffer> iM :<C-U>call <SID>wrap_i('[[','][')<CR>
199199
onoremap <silent> <buffer> aM :<C-U>call <SID>wrap_a('[[','][')<CR>
200200
xnoremap <silent> <buffer> iM :<C-U>call <SID>wrap_i('[[','][')<CR>

0 commit comments

Comments
 (0)