Registered Member
|
Hi,
I am running Kdevelop 5.2.0 on Linux Mint 18.1 64 bit. When editing c++, whenever I go to a new blank line and type in one curly brace '{' (the other brace is auto-completed) for something like the body of a function or the code after an if-statement, the pair of braces immediately goes to the beginning of a line regardless of my indentation level before. I have tried to change some settings in the code formatter and the settings in the indentation options, but none of these have helped. How can I resolve this issue so that I don't have to keep repeatedly manually indenting my code to the correct place? --Update--: Whenever I have 'Enable automatic brackets' enabled, this does not happen (the curly brace does not go to the beginning of the current line). |
Global Moderator
|
|
Registered Member
|
I don't know what you mean. However, if you mean which indenting character I use, I have tried will all the three options: Tabulators, Spaces and both Tabulators and spaces. Neither of these options solve my problem.
|
Global Moderator
|
It's in the settings, under Editor -> Editing -> Indentation. Try F7 -> type "set-indent-mode cstyle" -> press enter, is the issue gone then?
I'm working on the KDevelop IDE.
|
Registered Member
|
This time, the curly braces go back an indentation level instead of the beginning of the line. But it's still less annoying than before.
|
Global Moderator
|
Hm well, that is what the cstyle indenter is supposed to do. If you do not like this behaviour, you can use either the Normal indenter (always keeps the previous indent) or the None indenter (no auto-indent behaviour at all, i.e. new lines always start at column 0). Probably you used the strange "cpp / boost style" indenter before, can you look that up?
I'm working on the KDevelop IDE.
|
Registered users: Bing [Bot], daret, Google [Bot], Sogou [Bot]