diff --git a/org.eclipse.tm4e.language_pack/syntaxes/cpp/c.language-configuration.json b/org.eclipse.tm4e.language_pack/syntaxes/cpp/c.language-configuration.json index cb1fb733..58b416e3 100644 --- a/org.eclipse.tm4e.language_pack/syntaxes/cpp/c.language-configuration.json +++ b/org.eclipse.tm4e.language_pack/syntaxes/cpp/c.language-configuration.json @@ -122,11 +122,38 @@ }, "afterText": { "pattern": "^(?!\\s*$).+" + }, "action": { "indent": "none", "appendText": "// " } }, + // Start of /* or /** -> create block comment and indent + { + "beforeText": { + "pattern": "^\\s*/\\*\\*?" + }, + "afterText": { + "pattern": "^\\s*(\\*/)?$" + }, + "action": { + "indent": "indentOutdent", + "appendText": " * " + } + }, + // Inside block comment -> keep inside block comment and don't indent + { + "beforeText": { + "pattern": "^\\s*\\*(?!/)(?!.*\\*/\\s*$).*" + }, + "afterText": { + "pattern": "^\\s*" + }, + "action": { + "indent": "none", + "appendText": "* " + } + } ] } diff --git a/org.eclipse.tm4e.language_pack/syntaxes/cpp/cpp.language-configuration.json b/org.eclipse.tm4e.language_pack/syntaxes/cpp/cpp.language-configuration.json index cb1fb733..b30fee7d 100644 --- a/org.eclipse.tm4e.language_pack/syntaxes/cpp/cpp.language-configuration.json +++ b/org.eclipse.tm4e.language_pack/syntaxes/cpp/cpp.language-configuration.json @@ -128,5 +128,31 @@ "appendText": "// " } }, + // Start of /* or /** -> create block comment and indent + { + "beforeText": { + "pattern": "^\\s*/\\*\\*?" + }, + "afterText": { + "pattern": "^\\s*(\\*/)?$" + }, + "action": { + "indent": "indentOutdent", + "appendText": " * " + } + }, + // Inside block comment -> keep inside block comment and don't indent + { + "beforeText": { + "pattern": "^\\s*\\*(?!/)(?!.*\\*/\\s*$).*" + }, + "afterText": { + "pattern": "^\\s*" + }, + "action": { + "indent": "none", + "appendText": "* " + } + } ] }