Skip to content

qmdiEditor: run clang-format on save (172)#173

Closed
diegoiast wants to merge 4 commits intomainfrom
172-clang-format
Closed

qmdiEditor: run clang-format on save (172)#173
diegoiast wants to merge 4 commits intomainfrom
172-clang-format

Conversation

@diegoiast
Copy link
Collaborator

  1. Separate load/save events.
  2. New configuration: clang-format, and when to save
  3. When a file gets saved, run run "clang-format" depending on user configuration. This is done based on file extension, doing it only for supported types.

A cool improvement might be doing a file extension. We can have a configuration file
with a extension, binary to execute, and which where to download it.

For example:

closes #172

@diegoiast diegoiast self-assigned this Feb 13, 2026
@diegoiast diegoiast linked an issue Feb 13, 2026 that may be closed by this pull request
@diegoiast diegoiast added the Text editor Issues related to the text editor plugin label Feb 13, 2026
@diegoiast diegoiast force-pushed the 172-clang-format branch 2 times, most recently from 34693de to 5cf80d0 Compare February 13, 2026 22:16
@diegoiast diegoiast marked this pull request as ready for review February 14, 2026 19:17
Previously, this was an implementation detail of `qmdiEditor` that
leaked. It was used also in the git plugin.

Now, this is migrated to a full widget. With a very minimal implementation.

In hope that `GitPlugin.cpp` will remove the dependency (see diegoiast/qmdilib#34)
When a file gets reloaded from disk, the user can undo the loading.
Before, when reloaded, all undo history was lost.
1) Separate load/save events.
2) New configuration: clang-format, and when to save
3) When a file gets saved, run run "clang-format" depending on user configuration.
   This is done based on file extension, doing it only for supported types.

A cool improvement might be doing a file extension. We can have a configurtion file
with a extension, binary to execute, and which where to download it.

For example:
bash can be formatted using https://github.com/mvdan/sh which is written in GO, so installation is simple as the ctags plugin.

rust,go are baked into the toolchains.

cmake has https://github.com/cheshirekow/cmake_format

closes #172
@diegoiast
Copy link
Collaborator Author

merged in 8646b64

@diegoiast diegoiast closed this Feb 14, 2026
@github-project-automation github-project-automation bot moved this from Backlog to Done in CodePointer IDE Feb 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Text editor Issues related to the text editor plugin

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

clang-format

1 participant