Header files

Hello.

A few times ago, I have updated my CLion and I got the next problem:

IDE did something and I started to use a new version. I fond the next problem:

When I use/work with a header file (.h) and press the keys: Opt + Cmd + L  (code formatting) I have next result
First press:

#ifdef __cplusplus
extern "C" {
#endif

Second press:

#ifdef __cplusplus
extern "C" {

#endif

Third press:

#ifdef __cplusplus
extern "C" {


#endif

If you will try to press these keys more and more times the maximum number of the new lines until “#endif” is 3.

I do not remember that I had this problem before.

I only change the header template (removed the project name from #ifndef MYPERSONAL_H #define MYPERSONAL_H), a few times ago. These settings gone/reseted after the failed update process.

 

Current info:

MacBook M3, Sequoia 15.7

CLion 2025.2.2
Build #CL-252.26199.153, built on September 17, 2025
Source revision: 81b8711b6961c
Licensed to USER
Subscription is active until July 4, 2026.
Runtime version: 21.0.8+9-b1038.71 aarch64 (JCEF 122.1.9)
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
Toolkit: sun.lwawt.macosx.LWCToolkit
macOS 15.7
.NET Core v8.0.11 ARM64 (Server GC)
GC: G1 Young Generation, G1 Concurrent GC, G1 Old Generation
Memory: 2304M
Cores: 12
Metal Rendering is ON
Registry:
 actionSystem.update.actions.warn.dataRules.on.edt=false
 debugger.attach.dialog.enabled=true
 run.processes.with.pty=TRUE
 ide.experimental.ui=true
 ide.slow.operations.assertion=false
 cache.folding.model.on.disk=false
 llm.show.ai.promotion.window.on.start=false
Non-Bundled Plugins:
 org.jetbrains.plugins.yaml (252.26199.169)
 JavaScriptDebugger (252.26199.169)
 com.intellij.qt (252.26199.157)
 PythonCore (252.26199.169)
 org.jetbrains.completion.full.line (252.26199.169)
 org.toml.lang (252.26199.169)
 com.jetbrains.space (252.26199.7)
 Subversion (252.26199.158)
 SerialPortMonitor (252.26199.169)
 com.intellij.copyright (252.26199.169)
 com.jetbrains.restClient (252.26199.169)
 Docker (252.26199.168)
 com.intellij.react (252.26199.169)
 org.jetbrains.plugins.vue (252.26199.163)
 com.intellij.lang.qml (252.26199.157)
 com.intellij.mcpServer (252.26199.168)
 mobi.hsz.idea.gitignore (4.5.6)
 org.exbin.deltahex.intellij (0.2.12)
 

 

0
1 comment

Hello!

When I use/work with a header file (.h) and press the keys: Opt + Cmd + L  (code formatting) I have next result

  1. Does the issue happen only in header files? 
  2. Please open the header file where the issue is reproducible, place the caret in the code of this file, and provide a screenshot of the entire CLion window.
0

Please sign in to leave a comment.