Skip to content

Instantly share code, notes, and snippets.

@countoren
Last active May 31, 2020 02:36
Show Gist options
  • Save countoren/ef69a5b1f31dfe733c66a2618a065999 to your computer and use it in GitHub Desktop.
Save countoren/ef69a5b1f31dfe733c66a2618a065999 to your computer and use it in GitHub Desktop.
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