I want to write function that passes current line and file to external program and saves its output into register, e.g:
function Foo() let l:current_line = line(".") let l:current_file = expand("%:p:S") let @" = system("command-foo " . l:current_file . " " . l:current_line endfunction
Problem with that code is that if external command fail, function will succeed, but will store error message into register instead of regular output. How can I get exit code of
system invocation, so I can do error checking?