Bug 242723

Summary: Pasting over certain parentheses-enclosed text moves end parenthesis to before pasted selection
Product: [Applications] kate Reporter: John R. Chase <john_r_chase>
Component: partAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: sjakub
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description John R. Chase 2010-06-24 21:31:55 UTC
Version:           unspecified (using KDE 4.4.2) 
OS:                Linux

When I select a portion of comma-separated arguments within parentheses:

blah ( int a,
       int b,
       int c )

for example if I select from the start of "int b" to the end of "int c", then do ctrl-c , ctrl_v to copy & paste in place, the end parenthesis moves to a position before the selected text portion:

blah ( int a,
 )     int b,
       int c


Reproducible: Always

Steps to Reproduce:
Open kate, and in the empty document, paste:

blah ( int a,
       int b,
       int c )

Then select from the beginning character of "int b" to the end character of "int c". Then do ^c followed by ^v.

Actual Results:  
The text becomes:

blah ( int a,
 )     int b,
       int c


Expected Results:  
I expected the text to remain unchanged.
Comment 1 Dominik Haumann 2010-06-24 22:23:56 UTC
Settings > Configure Kate > Editor > Editing > Misc: [ ] Remove trailing spaces
Is that activated? If you deactivate it, do you still have the bug?
Comment 2 Dominik Haumann 2010-06-24 22:25:24 UTC
True, can reproduce. It's indeed the remove-trailing-spaces option.
Comment 3 Dominik Haumann 2011-08-08 08:29:37 UTC
Git commit 494afe2dacbe069797ac72213a08983deaee8895 by Dominik Haumann.
Committed on 08/08/2011 at 10:28.
Pushed by dhaumann into branch 'master'.

do not remove-trailing-spaces during paste

BUG: 242723

M  +1    -1    part/document/katedocument.cpp

http://commits.kde.org/kate/494afe2dacbe069797ac72213a08983deaee8895
Comment 4 Dominik Haumann 2011-08-08 08:30:39 UTC
Git commit f530cee6729e7a621e02de783d9e0b97a762ddf4 by Dominik Haumann.
Committed on 08/08/2011 at 10:29.
Pushed by dhaumann into branch 'master'.

add unit test for bug 242723

CCBUG: 242723

A  +70   -0    part/tests/bug242723_test.cpp     [License: LGPL (v2+)]
M  +11   -0    part/tests/CMakeLists.txt
A  +37   -0    part/tests/bug242723_test.h     [License: LGPL (v2+)]

http://commits.kde.org/kate/f530cee6729e7a621e02de783d9e0b97a762ddf4
Comment 5 Dominik Haumann 2011-08-08 08:34:25 UTC
Git commit f40c79cb1d54109439322469eaf080a5630d8dd9 by Dominik Haumann.
Committed on 08/08/2011 at 10:28.
Pushed by dhaumann into branch 'KDE/4.7'.

do not remove-trailing-spaces during paste

BUG: 242723

M  +1    -1    part/document/katedocument.cpp

http://commits.kde.org/kate/f40c79cb1d54109439322469eaf080a5630d8dd9
Comment 6 Dominik Haumann 2011-08-11 14:17:16 UTC
*** Bug 266710 has been marked as a duplicate of this bug. ***