1
0
mirror of https://github.com/SpaceVim/SpaceVim.git synced 2025-02-03 02:00:05 +08:00

Fix shell key binding (#3293)

This commit is contained in:
Wang Shidong 2020-01-22 20:26:49 +08:00 committed by GitHub
parent 0a94f76cd5
commit 5927bab905
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -96,9 +96,10 @@ func! SpaceVim#layers#shell#ctrl_r() abort
return "\<C-r>" return "\<C-r>"
endfunction endfunction
func! SpaceVim#layers#shell#ctrl_w() abort func! SpaceVim#layers#shell#ctrl_w() abort
let cursorpos = term_getcursor(s:term_buf_nr) let cursorpos = getcurpos()
let line = getline(cursorpos[0])[:cursorpos[1]-1] let line = getline(cursorpos[1])[:cursorpos[2]-1]
let str = matchstr(line, '[^ ]*\s*$') let str = matchstr(line, '[^ ]*\s*$')
return repeat("\<BS>", len(str)) return repeat("\<BS>", len(str))
endfunction endfunction