When I create a new C++ source file, the indentation of it was set to 1 automately and the 1 indentation has become the file indentation. But I have configed the application’s setting “Indentation=4” as the defalut mode. Before of thease days, it performed good, just make the new file’s indetation fit application’s defalut indentation settings. So, if there exists something I ignored or how can I make the new file’s indentation become 4 or fit default settings.
Kate uses modes on top of the default (normal) settings you have defined. Make sure 1) You have the right mode selected with the file open - Tools>Mode, and that the modes are defined correctly in Settings>Configure Kate>Editing>Indentation - each mode can be defined separately.
I know what the kate modes & filetypes means, and before I write the topic, I have try to fix the option of it, locking the option of cpp “Indentation=4”. But it has no effects, because as we all know, there also exists a key option to fit the indentation width of files themselves. What I say is that the new blanked cpp source file has been recognized as a file with 1 indentation style though it has nothing. And the python source file doesn’t has the problem, it performs good with 4 indentation. So the issue… Solving it may be difficult. Personally I think.
Out of the box Kate indents new CPP files with an indentation of 4 on my system (Manjaro KDE Plasma stable branch).
Modifying the C Style indentation profile works to change the indentation behaviour just fine.
Have you tried backing up your kate config files, removing them and using the defaults? Does it still not respect indentation correctly?
I feel it’s a configuration issue on your system.
In kate, it performs well. But in kdevelop, it performs bad though I delete the kdeveloprc config file and reset the config.
I have solve it, I need to create such as a clang format file.
Hi,
What are the steps to reproduce please? I’m not really clear on what happened here.
First, in KDevelop settings, I use default built-in source formatter option (the option clang and the option kdevelop). Obviously, it should have no effects because I haven’t configure it at all. But in C++ source file, the indentation fixed to 1 no matter how many times change the indentation. But now I write my formatter script, and the problem was solved. The default clang-format indentation is 2, I know. But the kdevelop perform 1 both of tow options, and I don’t know what I did, the indentation of default clang-format 1 changed to 2? Maybe it’s my fault?
It sounds like a bug in handling defaults/non-existent values. That’s why I’m trying to understand what actually happened: to reproduce.
