Bug 266710 - incorrect pasting with "remove trailing spaces while editing" enabled
Summary: incorrect pasting with "remove trailing spaces while editing" enabled
Status: RESOLVED DUPLICATE of bug 242723
Alias: None
Product: kate
Classification: Applications
Component: part (show other bugs)
Version: 0.2
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-20 03:44 UTC by Jakub Schmidtke
Modified: 2011-08-11 14:17 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jakub Schmidtke 2011-02-20 03:44:32 UTC
Version:           4.2.0 (using KDE 4.6.0) 
OS:                Linux

When I paste content of the clipboard and I have some text selected starting not at the beginning of the line and ending in the same column in the next line (one or more) the result is messed up.

Reproducible: Always

Steps to Reproduce:
Copy "3" to the clipboard (just the number 3)
In Kdevelop: File->New
Enter two lines of text:
 1
 2
(each of those lines has a single space at the beginning - so both lines have 2 characters)
Using the mouse select text starting just before '1' (so between the first space and '1'), and ending just before '2' (so between the second space in the file and '2') - so when the cursor is positioned just before '1' hold shift and press down arrow.
Press Ctrl-V.
Instead of getting ' 32' (pasting 3 before 2 and after the first space) it is '23'.
In general entering text or pasting something with different configurations of the number of spaces in front and selection gives weird results - characters in the wrong order, or spaces in wrong places.

This is not a critical error, but is extremely annoying...


Actual Results:  
23


Expected Results:  
32

OS: Linux (x86_64) release 2.6.37-ARCH
Compiler: gcc
Comment 1 Milian Wolff 2011-03-03 19:15:41 UTC
works for me, please be more specific

- do you use some custom input method (chinese characters or something)
- do you use VI mode
- do you have block selection turned on
- ... anything you can come up with
Comment 2 Jakub Schmidtke 2011-03-03 19:23:12 UTC
Regular input method, English language.
No VI mode
No block selection.
Changing the indentation style doesn't affect that.

However, I just noticed that in only appears when I have
"Remove trailing spaces while editing" enabled in "Settings->Configure Editor->Editing".

I also tried changing other settings in 'Configure Editor' and they don't change this behaviour, it looks like the "trailing spaces" option is the one responsible for that behhaviour.
Comment 3 Jakub Schmidtke 2011-03-03 19:29:27 UTC
Actually, disabling "Remove trailing spaces while editing" and enabling "Remove trailing spaces" in Open/Save section gives me the behaviour I am fine with, so at least it's a workaround.
Still, there is something weird going on when that first option is enabled.
Comment 4 Milian Wolff 2011-03-03 20:13:07 UTC
confirmed, it's a kate bug
Comment 5 Jakub Schmidtke 2011-03-03 20:17:39 UTC
I tried kate before and it was fine, but I didn't have this option enabled there. Now I tried enabling it and it indeed happens in kate as well.

Anyway, thanks for your help and prompt responses! I really appreciate it! :)
Comment 6 Dominik Haumann 2011-08-11 14:17:16 UTC
I fixed that for KDE 4.7.1.

*** This bug has been marked as a duplicate of bug 242723 ***