Hi, Create a new file.c with the following content: --%<-- typedef struct myStruct { int x; } myStruct; myStruct fn() { } -->%-- Now try to insert the line "return (myStruct) { .x = 0 };" inside fn(). As soon as you type "." Kdevelop immediately turns it into "->". Now try to correct that. The only way I've found that doesn't get immediately replaced again is to paste a "." from the clipboard. Best, Brendon
I want to add that whatever logic replaces "." with "->" also triggers after CTRL+Z. So in some circumstances the Undo action can be rendered difficult or unusable.
I remember being hit with this obstinate replacement in a heavily-templated C++ source file about a year ago. Working this around can be difficult and annoying.
*** Bug 449441 has been marked as a duplicate of this bug. ***
(In reply to Brendon Higgins from comment #1) > I want to add that whatever logic replaces "." with "->" also triggers after > CTRL+Z. So in some circumstances the Undo action can be rendered difficult > or unusable. This is Bug 364411.
To the reporters of this bug and its duplicate: could you check if this bug is still reproducible and with which KDevelop and Clang versions? This question came up in a review of a fix here: https://invent.kde.org/kdevelop/kdevelop/-/merge_requests/392#note_570228
Hello! I just tried it in KDevelop 5.8.220401 with Clang 14.0.6-2 (so says "clang -v"). Happy to report the issue seems to no longer be present.
If anyone experiences this bug again, before reopening please test in KDevelop version that includes the fix for a similar issue https://commits.kde.org/kdevelop/560c06ffb01dff577b58e3f2026ece17c49a0ed0. This fix will be released in KDevelop version 5.11.230400.