src/nvim/fileio.c
/// Like apply_autocmds(), but handles the caller's retval.  If the script
/// processing is being aborted or if retval is FAIL when inside a try
/// conditional, no autocommands are executed.  If otherwise the autocommands
/// cause the script to be aborted, retval is set to FAIL.
///
/// @param event event that occurred
/// @param fname NULL or empty means use actual file name
/// @param fname_io fname to use for <afile> on cmdline
/// @param force When true, ignore autocmd_busy
/// @param buf Buffer for <abuf>
/// @param[in,out] retval caller's retval
///
/// @return true if some autocommands were executed
Like apply_autocmds(), but handles the caller's retval.  If the script
processing is being aborted or if retval is FAIL when inside a try
conditional, no autocommands are executed.  If otherwise the autocommands
cause the script to be aborted, retval is set to FAIL.
Like apply_autocmds () but handles the caller ' s retval . If the script processing is being aborted or if retval is FAIL when inside a try conditional no autocommands are executed . If otherwise the autocommands cause the script to be aborted retval is set to FAIL .
bool apply_autocmds_retval(event_T event, char_u *fname, char_u *fname_io,
                           bool force, buf_T *buf, int *retval)
{
  if (should_abort(*retval)) {
    return false;
  }
  bool did_cmd = apply_autocmds_group(event, fname, fname_io, force,
                                      AUGROUP_ALL, buf, NULL);
  if (did_cmd && aborting()) {
    *retval = FAIL;
  }
  return did_cmd;
}
bool apply_autocmds_retval ( event_T event , char_u * fname , char_u * fname_io , bool force , buf_T * buf , int * retval ) { if ( should_abort ( * retval ) ) { return false ; } bool did_cmd = apply_autocmds_group ( event , fname , fname_io , force , AUGROUP_ALL , buf , NULL ) ; if ( did_cmd && aborting ( ) ) { * retval = FAIL ; } return did_cmd ; }
Like apply_autocmds(), but handles the caller's retval.
Like apply_autocmds () but handles the caller ' s retval .