src/nvim/fileio.c
/*
 * Show the autocommands for one AutoPat.
 */
Show the autocommands for one AutoPat.
Show the autocommands for one AutoPat .
static void show_autocmd(AutoPat *ap, event_T event)
{
  AutoCmd *ac;
  if (got_int)
    return;
  if (ap->pat == NULL)                  
    return;
  msg_putchar('\n');
  if (got_int)
    return;
  if (event != last_event || ap->group != last_group) {
    if (ap->group != AUGROUP_DEFAULT) {
      if (AUGROUP_NAME(ap->group) == NULL) {
        msg_puts_attr(get_deleted_augroup(), HL_ATTR(HLF_E));
      } else {
        msg_puts_attr(AUGROUP_NAME(ap->group), HL_ATTR(HLF_T));
      }
      msg_puts("  ");
    }
    msg_puts_attr(event_nr2name(event), HL_ATTR(HLF_T));
    last_event = event;
    last_group = ap->group;
    msg_putchar('\n');
    if (got_int)
      return;
  }
  msg_col = 4;
  msg_outtrans(ap->pat);
  for (ac = ap->cmds; ac != NULL; ac = ac->next) {
    if (ac->cmd == NULL) {              
      continue;
    }
    if (msg_col >= 14) {
      msg_putchar('\n');
    }
    msg_col = 14;
    if (got_int) {
      return;
    }
    msg_outtrans(ac->cmd);
    if (p_verbose > 0) {
      last_set_msg(ac->script_ctx);
    }
    if (got_int) {
      return;
    }
    if (ac->next != NULL) {
      msg_putchar('\n');
      if (got_int) {
        return;
      }
    }
  }
}
static void show_autocmd ( AutoPat * ap , event_T event ) { AutoCmd * ac ; if ( got_int ) return ; if ( ap -> pat == NULL ) return ; msg_putchar ( ' \n ' ) ; if ( got_int ) return ; if ( event != last_event || ap -> group != last_group ) { if ( ap -> group != AUGROUP_DEFAULT ) { if ( AUGROUP_NAME ( ap -> group ) == NULL ) { msg_puts_attr ( get_deleted_augroup ( ) , HL_ATTR ( HLF_E ) ) ; } else { msg_puts_attr ( AUGROUP_NAME ( ap -> group ) , HL_ATTR ( HLF_T ) ) ; } msg_puts ( " " ) ; } msg_puts_attr ( event_nr2name ( event ) , HL_ATTR ( HLF_T ) ) ; last_event = event ; last_group = ap -> group ; msg_putchar ( ' \n ' ) ; if ( got_int ) return ; } msg_col = 4 ; msg_outtrans ( ap -> pat ) ; for ( ac = ap -> cmds ; ac != NULL ; ac = ac -> next ) { if ( ac -> cmd == NULL ) { continue ; } if ( msg_col >= 14 ) { msg_putchar ( ' \n ' ) ; } msg_col = 14 ; if ( got_int ) { return ; } msg_outtrans ( ac -> cmd ) ; if ( p_verbose > 0 ) { last_set_msg ( ac -> script_ctx ) ; } if ( got_int ) { return ; } if ( ac -> next != NULL ) { msg_putchar ( ' \n ' ) ; if ( got_int ) { return ; } } } }
Show the autocommands for one AutoPat.
Show the autocommands for one AutoPat .
/* Check for "got_int" (here and at various places below), which is set
   * when "q" has been hit for the "--more--" prompt */ /* pattern has been removed */ /* skip removed commands */