1

当在 gvim 中选择以下代码并点击“=”时,它会将括号左移到构造函数上。这是一个 gvim 错误还是我可能必须设置修复的一些设置?

输出:

class GameData
{
  public:
    enum Key { A=0, B, C, D, TOTAL_KEYS };

    GameData() : moves_() , numKeys_(TOTAL_KEYS) 
  {
    populateMoves();
  }

    inline const std::vector<Key>& getMoves ( int k ) const 
    { 
      return moves_[k];
    }

期望的输出:

class GameData
{
  public:
    enum Key { A=0, B, C, D, TOTAL_KEYS };

    GameData(): moves_(), numKeys_(TOTAL_KEYS) 
    {
      populateMoves();
    }

    inline const std::vector<Key>& getMoves ( int k ) const 
    { 
      return moves_[k];
    }
4

1 回答 1

1

设置cino=i0使语句与我的 vim 安装正确对齐。

从帮助

                        *cino-i*
iN    Indent C++ base class declarations and constructor
      initializations, if they start in a new line (otherwise they
      are aligned at the right side of the ':').
      (default 'shiftwidth').
于 2013-09-20T05:01:19.883 回答