Bug 354971 - Rename assistant cannot insert more than one character in new name
Summary: Rename assistant cannot insert more than one character in new name
Status: RESOLVED FIXED
Alias: None
Product: kdevelop
Classification: Applications
Component: general (show other bugs)
Version: git master
Platform: Mageia RPMs Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-07 01:08 UTC by Piotr Mierzwinski
Modified: 2015-11-09 17:09 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Piotr Mierzwinski 2015-11-07 01:08:44 UTC
I'm not able to rename local variables if new name is longer more than one character from original name. Please check below code (please also consider tabulator indent on begin both lines inside function body):
void foo()
{
	QString sString = "string";
	sString.replace('s', 'S');
}

Reproducible: Always

Steps to Reproduce:
1. move cursor on begin of declaration string "sString" (before 's')
2. start typing new characters, for example 123
3. typing every next character please look at right bottom corner of editor, where  the Rename assistant is displayed

Actual Results:  
as output string always will be "1sString"

Expected Results:  
output string should looks like this: "123sString"

Please note that, the position in the name of variable where you start typing doesn't matter. This might be position after first character, after second character or even after last character. Always result will be the same. Into output string is inserted only one character! Of course pressing Alt+1 put only such string, so in this example: "1sString". 

This bug made that we are not able rename variable if we want to update it with more than one character.

There is also "unpleasant" side effect.
The side effect is that, on begin of renamed string are inserted several spaces. For me it was 6 spaces. Please consider that I have set indention as tabulator (length 4 characters). I can create new bug report for this "side effect" if you want. I'm not sure how close this is related with bug described before.

Kate, KTextEditor, KDevelop and KDevplatform cloned at 04.11.2015
Comment 1 Milian Wolff 2015-11-09 15:16:46 UTC
I could reproduce this. The side-effect was already reported in bug 317299 correct? Otherwise, please report it.
Comment 2 Milian Wolff 2015-11-09 15:45:10 UTC
Git commit 60d8b7d2303a0ff5fbbf15296f60bc82856ba5d3 by Milian Wolff.
Committed on 09/11/2015 at 15:44.
Pushed by mwolff into branch '5.0'.

Properly update the assistant popup contents when the actions changed.

M  +2    -0    shell/assistantpopup.cpp

http://commits.kde.org/kdevplatform/60d8b7d2303a0ff5fbbf15296f60bc82856ba5d3
Comment 3 Piotr Mierzwinski 2015-11-09 17:09:26 UTC
(In reply to Milian Wolff from comment #1)
> The side-effect was already reported in bug 317299 correct? Otherwise, please report it.

Correct. I realized that just after sent this report.
Thanks for quick fix.