Allow mappings which aren't special chars
This commit is contained in:
parent
f2d407256e
commit
49a9a4b367
2 changed files with 15 additions and 12 deletions
|
|
@ -135,18 +135,21 @@ function! vimspector#internal#balloon#MouseFilter( winid, key ) abort
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
function! s:MatchKey( key, candidates ) abort
|
function! s:MatchKey( key, candidates ) abort
|
||||||
let mapped = ''
|
|
||||||
for candidate in a:candidates
|
for candidate in a:candidates
|
||||||
try
|
" If the mapping string looks like a special character, then try and
|
||||||
" Try and expand the key code. Note this won't work for non-special keys
|
" expand it. This is... a hack. The whole thing only works if the mapping
|
||||||
" and it won't work for multple keys, which is kinda shitty.
|
" is a single key (anyway), and so we assume any string starting with < is a
|
||||||
"
|
" special key (which will be the common case) and try and map it. If it
|
||||||
" There's no vim api to run expand_keycodes() i don't think.
|
" fails... it fails.
|
||||||
execute 'let mapped = "\' . candidate . '"'
|
if candidate[ 0 ] == '<'
|
||||||
if mapped ==# a:key
|
try
|
||||||
return v:true
|
execute 'let candidate = "\' . candidate . '"'
|
||||||
endif
|
endtry
|
||||||
endtry
|
endif
|
||||||
|
|
||||||
|
if candidate ==# a:key
|
||||||
|
return v:true
|
||||||
|
endif
|
||||||
endfor
|
endfor
|
||||||
|
|
||||||
return v:false
|
return v:false
|
||||||
|
|
|
||||||
|
|
@ -152,7 +152,7 @@ augroup END
|
||||||
let g:vimspector_mappings = {
|
let g:vimspector_mappings = {
|
||||||
\ 'stack_trace': {},
|
\ 'stack_trace': {},
|
||||||
\ 'variables': {
|
\ 'variables': {
|
||||||
\ 'set_value': [ '<Tab>', '<C-CR>' ],
|
\ 'set_value': [ '<Tab>', '<C-CR>', 'C' ],
|
||||||
\ }
|
\ }
|
||||||
\ }
|
\ }
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue