Skip to content

C++ Mode v0.2.2

Latest

Choose a tag to compare

@pepc84 pepc84 released this 24 Jun 20:35

Fixed

  • Editor: Enter/Tab indentation now matches Java mode. The C++ mode editor's auto-indent on Enter previously hard-coded a 4-space indent after { (ignoring the editor.tabs.size preference) and copied raw tab characters into new lines instead of normalizing to spaces, which made whitespace behave inconsistently compared to Java sketches.
  • Closing braces now auto-dedent. Typing } on its own line now outdents to match its corresponding {, mirroring Java mode. This was previously missing entirely in C++ mode.
  • Tab / Shift+Tab now respect editor preferences. Tab now inserts spaces or a literal tab according to editor.tabs.expand/editor.tabs.size, and Shift+Tab now outdents — previously Tab always inserted a literal tab and Shift+Tab had no effect.
  • No more duplicated whitespace on Enter. Pressing Enter in the middle of a line with trailing spaces no longer doubles up the indent.
  • Ctrl+Up / Ctrl+Down jump-to-blank-line navigation, present in Java mode, is now available in C++ mode as well.

Internal

  • Added CppInputHandler (mirrors upstream Processing's JavaInputHandler) to own all of this key-handling logic in one place, replacing a set of ad-hoc key bindings in CppEditor.

Full diff: src/java/CppEditor.java, src/java/CppInputHandler.java (new)