Repository: neovim/neovim
File: src/nvim/ex_docmd.c (C)

Code before:
      "                                      +##,", a);
  msg("   :##################WMxz+,                                  "
      "                                      ,##i", a);
  msg("   n#######################W..,                               "
      "                                       W##", a);
  msg("  +#########################WW@+. .:.                         "
      "                                       z#x", a);
  msg(" `@#############################@@###:                        "
      "                                       *#W", a);
  msg(" #################################Wz:                         "
      "                                       :#@", a);
  msg(",@###############################i                            "
      "                                       .##", a);
  msg("n@@@@@@@#########################+                            "
      "                                       `##", a);
  msg("`      `.:.`.,:iii;;;;;;;;iii;;;:`       `.``                 "
      "                                       `nW", a);
}

/// Get argt of command with id
uint32_t get_cmd_argt(cmdidx_T cmdidx)
{
  return cmdnames[(int)cmdidx].cmd_argt;
}

/// Check if a command is a mapping/abbreviation command by examining its handler function
bool is_mapping_command(cmdidx_T cmdidx)
{
  if (IS_USER_CMDIDX(cmdidx)) {
    return false;
  }

  ex_func_T func = cmdnames[cmdidx].cmd_func;
  return func == ex_map           // :map, :nmap, :noremap, etc.
         || func == ex_unmap         // :unmap, :nunmap, etc.
         || func == ex_mapclear      // :mapclear, :nmapclear, etc.
         || func == ex_abbreviate    // :abbreviate, :iabbrev, etc.
         || func == ex_abclear;      // :abclear, :iabclear, etc.
}


Review comment (suggestion):
```suggestion
/// Check if a command is a :map/:abbrev command.
```

Code after:
      "                                      +##,", a);
  msg("   :##################WMxz+,                                  "
      "                                      ,##i", a);
  msg("   n#######################W..,                               "
      "                                       W##", a);
  msg("  +#########################WW@+. .:.                         "
      "                                       z#x", a);
  msg(" `@#############################@@###:                        "
      "                                       *#W", a);
  msg(" #################################Wz:                         "
      "                                       :#@", a);
  msg(",@###############################i                            "
      "                                       .##", a);
  msg("n@@@@@@@#########################+                            "
      "                                       `##", a);
  msg("`      `.:.`.,:iii;;;;;;;;iii;;;:`       `.``                 "
      "                                       `nW", a);
}

/// Get argt of command with id
uint32_t get_cmd_argt(cmdidx_T cmdidx)
{
  return cmdnames[(int)cmdidx].cmd_argt;
}

/// Check if a command is a :map/:abbrev command.
bool is_map_cmd(cmdidx_T cmdidx)
{
  if (IS_USER_CMDIDX(cmdidx)) {
    return false;
  }

  ex_func_T func = cmdnames[cmdidx].cmd_func;
  return func == ex_map           // :map, :nmap, :noremap, etc.
         || func == ex_unmap         // :unmap, :nunmap, etc.
         || func == ex_mapclear      // :mapclear, :nmapclear, etc.
         || func == ex_abbreviate    // :abbreviate, :iabbrev, etc.
         || func == ex_abclear;      // :abclear, :iabclear, etc.
}