Last active
May 31, 2020 02:36
-
-
Save countoren/ef69a5b1f31dfe733c66a2618a065999 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function! Tapi_sp(bufnum, arglist) | |
let winid = bufwinid(a:bufnum) | |
let path = get(a:arglist, 0, '') | |
if winid == -1 || empty(path) | |
return | |
endif | |
call win_execute(winid, 'sp ' . path) | |
endfunction | |
# can be runned with | |
# printf '\033]51;["call", "Tapi_sp", ["%s"]]\007' "/somepath/config/" - does not throw error - buffer name : config/ | |
# printf '\033]51;["call", "Tapi_sp", ["%s"]]\007' "/somepath/config" - throw error - buffer created with name : config | |
# printf '\033]51;["call", "Tapi_sp", ["%s"]]\007' "$(pwd)" - works without error | |
# printf '\033]51;["call", "Tapi_sp", ["%s"]]\007' "onPathThatExists" - works without error (that path i tried was a dir) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment