Bug 383267

Summary: KDevelop inserts undesired characters while typing
Product: [Applications] kdevelop Reporter: rohan.preacher.smith
Component: Code completionAssignee: kdevelop-bugs-null
Status: RESOLVED NOT A BUG    
Severity: normal CC: mail, simonandric5
Priority: NOR    
Version: 5.1.1   
Target Milestone: ---   
Platform: Kubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: Sample C++ code showing explained behaviour

Description rohan.preacher.smith 2017-08-08 06:45:17 UTC
Created attachment 107146 [details]
Sample C++ code showing explained behaviour

KDevelop inserts whitespace that is incredibly annoying while trying to be "helpful". See attachment for undesired and desired behaviour. By entering the comment on line 6 or at the end of any other line with code, the comment was moved immediately to the 60th column. This behaviour only appears with C++ style comments and not with C style comments. There are no apparent options in Editor/Editing/Indentation, Source Formatter, or Language Support to disable or edit this behaviour. Other such instances of KDevelop automatically inserting characters or whitespace with no way to disable or edit it include namespace operator, stream operators, and comma operator. Instances of this behaviour being helpful include aligning new line continuations in macro definitions, but again there are no options to disable or edit it.
Comment 1 Sven Brauch 2017-08-08 08:24:22 UTC
In Settings -> Configure -> Editor -> Editing -> Indentation, what is the Default Indent mode?
Comment 2 rohan.preacher.smith 2017-08-08 11:17:16 UTC
Default indentation mode: Normal
Indent using: Spaces, tab and indentation width 4 characters.
Indentation properties: Keep extra spaces and adjust indentation both unchecked.
Indentation actions: Backspace key checked, increase indentation level if in leading blank space.

The behaviour is still there even in other indentation modes, although I only tested None, Normal, ada, CMake, C++/boost Style, C Style, and XML Style.
Comment 3 Sven Brauch 2017-08-08 11:31:10 UTC
Hmm, can you make sure you use the C indenter by pressing F7 and typing "set-indent-mode cstyle"? This sounds strange ...
Comment 4 rohan.preacher.smith 2017-08-08 11:49:42 UTC
Setting the indentation mode via that command changes to the preferred behaviour for a single file. Setting the indentation mode in Editor -> Open/Save for a Sources/C++ filetype with extension .hpp or .cpp to Use Default with default set to C Style, or C Style does not change the indentation mode of either a currently open file or a previously opened file, but does for a newly created file.
Comment 5 Sven Brauch 2017-08-08 22:34:05 UTC
Hm, so, is your issue solved ...?
Comment 6 rohan.preacher.smith 2017-08-09 01:43:40 UTC
I wouldn't call it solved, just different to what I thought it was though deserving of a different issue.
Comment 7 Sven Brauch 2017-08-09 04:32:53 UTC
Let me rephrase it, if you set the indenter to the cstyle indenter (which is the default) does it behave like you would expect it to?
Comment 8 rohan.preacher.smith 2017-08-09 06:35:37 UTC
Yeah, the indentation mode is what I expect in C Style.
Comment 9 Sven Brauch 2017-08-09 10:06:06 UTC
Ok, I'll take this as a data point that the C++ indenter should just be removed / renamed ;)
Comment 10 Kevin Funk 2017-08-17 14:45:28 UTC
FTR, a discussion was triggered on kwrite-devel:
  https://marc.info/?l=kwrite-devel&m=150227339428208&w=2