在我按下分号之前,所有内容都在我的 .cpp 文件中正常缩进;在以下几行中---此时emacs一直缩进到最后一行键入的全长......
如果我删除访问修饰符并为任何类或结构声明 vars int x 和 int y,这奇怪地不会发生。
class Blah {
private int x;
private int y;
private int z;
};
如果我突出显示整个字段并按 < TAB >,Emacs 会将其视为该区域的正确缩进。除了缩进自定义的其他问题之外,似乎找不到与此相关的任何其他内容
额外细节:
查克; 产生这个描述,所以它可能与这个特性有关——虽然我不明白,因为所描述的缩进似乎是指下一个换行符,而不是光标所在的当前行。
; runs the command c-electric-semi&comma (found in c++-mode-map),
which is an interactive compiled Lisp function in ‘cc-cmds.el’.
It is bound to ,, ;.
(c-electric-semi&comma ARG)
Insert a comma or semicolon.
If ‘c-electric-flag’ is non-nil, point isn’t inside a literal and a
numeric ARG hasn’t been supplied, the command performs several electric
actions:
(a) When the auto-newline feature is turned on (indicated by "/la" on
the mode line) a newline might be inserted. See the variable
‘c-hanging-semi&comma-criteria’ for how newline insertion is determined.
(b) Any auto-newlines are indented. The original line is also
reindented unless ‘c-syntactic-indentation’ is nil.
(c) If auto-newline is turned on, a comma following a brace list or a
semicolon following a defun might be cleaned up, depending on the
settings of ‘c-cleanup-list’.