Goal: print git diffs of pwd in a popup
let diff = system('git diff')
call popup_create(diff, {})
Problem: It prints ^@
(I've got to know that is newline chars):
diff --git a/.config/fish/config.fish b/.config/fish/config.fish^@deleted file mode 100644^@...(ellipsis)
How could I escape the newline chars in the variable diff
?
I tried substitute and it does not work:
let diff = system('git diff')
let diff = substitute(diff, '^@', '\n', 'g')
call popup_create(diff, {})