" Test for using complete() with completeopt+=longest
func Test_complete_with_longest()
- inoremap <f3> <cmd>call complete(1, ["iaax", "iaay", "iaaz"])<cr>
new
+ inoremap <buffer> <f3> <cmd>call complete(1, ["iaax", "iaay", "iaaz"])<cr>
" default: insert first match
set completeopt&
exe "normal Aa\<f3>\<esc>"
call assert_equal('iaa', getline(1))
set completeopt&
+ bwipe!
endfunc
" A mapping is not used for the key after CTRL-X.
func Test_no_mapping_for_ctrl_x_key()
new
- inoremap <C-K> <Cmd>let was_mapped = 'yes'<CR>
+ inoremap <buffer> <C-K> <Cmd>let was_mapped = 'yes'<CR>
setlocal dictionary=README.txt
call feedkeys("aexam\<C-X>\<C-K> ", 'xt')
call assert_equal('example ', getline(1))