1
0
mirror of https://github.com/amix/vimrc synced 2025-06-23 06:35:01 +08:00

Updated plugins

This commit is contained in:
Amir Salihefendic
2019-03-27 16:08:56 +01:00
parent bf7b5985f1
commit 5a2572df03
73 changed files with 1924 additions and 598 deletions

View File

@ -1230,7 +1230,7 @@ function! s:wait_for_user_input(mode)
let s:saved_keys = ""
endif
" ambiguous mappings are note supported; e.g.:
" ambiguous mappings are not supported; e.g.:
" imap jj JJ
" imap jjj JJJ
" will always trigger the 'jj' mapping
@ -1239,8 +1239,8 @@ function! s:wait_for_user_input(mode)
let s_time = s:get_time_in_ms()
while 1
let map_dict = maparg(s:char, "i", 0, 1)
" break if chars exactly match mapping or if chars don't match beging of mapping anymore
if map_dict != {} || mapcheck(s:char, "i") == ""
" break if chars exactly match mapping
if map_dict != {}
if get(map_dict, 'expr', 0)
" handle case where {rhs} is a function
exec 'let char_mapping = ' . map_dict['rhs']
@ -1251,6 +1251,10 @@ function! s:wait_for_user_input(mode)
exec 'let s:char = "'.substitute(char_mapping, '<', '\\<', 'g').'"'
break
endif
" break if chars don't match beginning of mapping anymore
if mapcheck(s:char, "i") == ""
break
endif
if s:get_time_in_ms() > (s_time + &timeoutlen)
break
endif

View File

@ -170,9 +170,12 @@ describe "Multiple Cursors op pending & exit from insert|visual mode" do
end
describe "Multiple Cursors when using insert mapings" do
describe "Multiple Cursors when using insert mappings" do
let(:filename) { 'test.txt' }
let(:options) { ['set timeoutlen=10000', 'imap jj <esc>', 'imap jojo dude'] }
let(:options) { ['set timeoutlen=10000',
'imap jj <esc>',
'imap jojo dude',
'imap jk <esc>:%s/bla/hey/g<cr>'] }
specify "#mapping doing <Esc>" do
before <<-EOF
hello world!
@ -191,6 +194,24 @@ describe "Multiple Cursors when using insert mapings" do
EOF
end
specify "#mapping doing <Esc> and running a command" do
before <<-EOF
hello world!
hello world!
bla bla bla
bla bla bla
EOF
type 'w<C-n><C-n>ctherejk'
after <<-EOF
hello there!
hello there!
hey hey hey
hey hey hey
EOF
end
specify "#mapping using more than 2 characters" do
before <<-EOF
hello
@ -209,6 +230,24 @@ describe "Multiple Cursors when using insert mapings" do
EOF
end
specify "#unused mapping" do
before <<-EOF
hello world!
hello world!
bla bla bla
bla bla bla
EOF
type 'w<C-n><C-n>chey joseph blah blah blah<Esc>'
after <<-EOF
hello hey joseph blah blah blah!
hello hey joseph blah blah blah!
bla bla bla
bla bla bla
EOF
end
end
describe "Multiple Cursors when normal_maps is empty" do