plugin CudaFormatter + its formatters

Plugins for SynWrite and CudaText...
SamC
Posts: 211
Joined: 12.08.2023 00:49

CudaFormatter plugin issues

Post by SamC »

Hello,
It seems cuda formatter supply 4 formater as maximum namde A B C and D, could we add more formatter to it?
Also what's the main purpose for cross-lexer formatter, I didn't use it now because not very sure about the meaning.
Thanks!
Attachments
20231028122036.png
20231028122036.png (7.68 KiB) Viewed 8628 times
main Alexey
Posts: 2990
Joined: 25.08.2021 18:15

Re: about cudaformatter

Post by main Alexey »

1. I am not sure we really need >4 formatters per one lexer. give me example of 5 formatters for one lexer.

2. WIki has the info:
https://wiki.freepascal.org/CudaText_plugins

Formatter cross-lexer 1...4
Runs formatter for current editor file, which has cross-lexer label (1, 2, 3, 4). For example, when you have a formatter XY assigned to the label "2", the command "Formatter cross-lexer: 2" always runs XY, ignoring the current lexer.
main Alexey
Posts: 2990
Joined: 25.08.2021 18:15

Re: about cudaformatter

Post by main Alexey »

'cross-lexer' formatter must be used only for special cases. when formatter is very general and/or can auto-detect the syntax/lexer.
SamC
Posts: 211
Joined: 12.08.2023 00:49

Re: about cudaformatter

Post by SamC »

Thanks, Now I know that the formatter ABCD can used for each different lexer. I used to take the formatter A can just used for one certain lexer, that's why I want to add more.
main Alexey
Posts: 2990
Joined: 25.08.2021 18:15

Re: about cudaformatter

Post by main Alexey »

yes, for example, you can have formatter FF1 assigned to 'B' for JavaScript;
and formatter CC1 assigned to 'B' for C++.
they both are called by 'formatter per-lexer B'.
dima8101
Posts: 23
Joined: 28.01.2026 19:30

Re: plugin CudaFormatter + its formatters

Post by dima8101 »

Please tell me how to configure auto-formatting for C++.
As I understand it, I need to install clang-format on the system. However, there is no C++ option in the CudaFormater settings. ConfigureFormatter does not display any window. clang-format is already installed on the system.
main Alexey
Posts: 2990
Joined: 25.08.2021 18:15

Re: plugin CudaFormatter + its formatters

Post by main Alexey »

If you call 'Plugins / Addon Manager / Install' and choose 'Category: formatter' in the menu, you will see - we don't have C++ formatters at all. 'clang-format' is the tool. but Cud needs the 'formatter' which uses clang-format. it is not created.

https://sourceforge.net/projects/cudate ... ormatters/
main Alexey
Posts: 2990
Joined: 25.08.2021 18:15

Re: plugin CudaFormatter + its formatters

Post by main Alexey »

Ops, I was wrong, we HAVE the C++ formatter:
"formatter: AStyle" supports C++.

Pls see its readme/readme.txt.
And see the wiki
https://wiki.freepascal.org/CudaText_plugins
it tells how to configure the 'auto formatting on save'.
It is configurable via 'Plugins / CudaFormatter / Configure on_save..."
dima8101
Posts: 23
Joined: 28.01.2026 19:30

Re: plugin CudaFormatter + its formatters

Post by dima8101 »

I installed the formatter plugin: AStyle, and configured it to work when saving and when called from the menu. However, the auto-formatting does not work. I can see that something is happening, as the cursor shape changes. When I first called it, there was an error window, but it no longer appears, and I do not remember what was in it.
main Alexey
Posts: 2990
Joined: 25.08.2021 18:15

Re: plugin CudaFormatter + its formatters

Post by main Alexey »

when plugin error occurs, usually it is a plugin crash, so see the Console panel for crash (red) lines there.
call Console by click on the sidebar button on bottom.
copy/paste here Console errors, if exist.

if Console has not error lines, tell me exact steps to repeat, to see the fail.
attach your settings-folder in zip file (delete private info from *history* files).
Post Reply