Auto-move to beginning of line


#1

I’m not sure how to fix this certain problem. I’ve selected the c++ grammar and when I’m building a linked list and type

class Node
{
public:
}

the public: moves to the beginning of the line as soon as you hit the colon button. I’m not sure how to fix this .


#2

If you’re familiar with how to edit the Atom configuration file, you can add these lines to it:

".cpp.source":
  editor:
    decreaseIndentPattern: '(?x)
       ^ \\s* (\\s* /[*] .* [*]/ \\s*)* \\}
      |^ \\s* (\\s* /[*] .* [*]/ \\s*)* \\)
      |^ \\s* @(public|private|protected) \\s* $
      '

This takes the editor.decreaseIndentPattern from the language-c package and removes the rule that decreases the indentation on lines containing public:, private:, or protected: