static void test_selection(void) { char *cmd; int bg; cmd = format_edit_selection_cmd(&bg); assert_string_equal("vim -p lfile0 lfile2", cmd); free(cmd); }
int vim_edit_selection(void) { int error = 1; int bg; char *const cmd = format_edit_selection_cmd(&bg); if(cmd != NULL) { error = run_vim(cmd, bg, 1); free(cmd); } return error; }