Problem: error set by win_set_buf may leak if autocommands immediately close the new window. Solution: free the error set by win_set_buf. (prefer nvim_open_win's error as it's more important and will cause 0 to be returned)
nvim_set_hl()
cterm