GNOME Bugzilla – Bug 401194
pasting text at other than present cursor location
Last modified: 2009-11-23 15:12:27 UTC
Please describe the problem: When I do a copy/paste, or cut/paste, it sometimes pastes the text at a location other than the present cursor position - sometimes before, sometimes after. Apparently random location. It does not depend on whether pasting text within same doc, or from other doc, and not depend on whether I use Ctrl-V or the paste icon. I always use gedit with .cpp files (C++) so do not know if it may happen with other types of files. Steps to reproduce: 1. Open .cpp file and select (hilite) some word on page, for example. 2. Press Ctrl-C, move to different location on page, click page to set new cursor position. 3. Press Ctrl-V. (describing normal copy / paste operation) Actual results: The selected text is pasted at some apparently random location in .cpp file. Expected results: I expect selected text to be pasted at present cursor location. Does this happen every time? Not consistent, happens maybe 1/4 of the time. Most of time is OK. Other information: Was happening with gedit 2.15.x, also happening with 2.16.2. Running Fedora Core 6 on Dell Pentium notebook.
*** Bug 412257 has been marked as a duplicate of this bug. ***
I never managed to reproduce this... does it still happen with newer gedit/gtk?
Update June 26, 2007 I have not tested with newer gedit/gtk (using gedit 2.16.2 / gnome 2.16.0), but I now think it is related to some problem with my system (Fedora 6 on Dell notebook) .... because I have been using the Geany programming editor (similar to gedit) and the problem also happens with that.
I also have the same problem. gedit version 2.20.4 in Fedora 8 Distribution I edit shell scripts with gedit version 2.20.4 When I do a copy/paste, or cut/paste by Pressing Ctrl-C,Ctrl-V,Ctrl-X It sometimes pastes the text at a location other than the present cursor position - sometimes before, sometimes after. It let me think gedit is unreliable.
Update: I now think the problem may have been related to clicking the scroll wheel on my mouse when I was scrolling between the "cut" location and the "paste location". I was seeing the problem both with gedit and the Geany programmer's editor, both running on gnome 2.20/ Fedora 8, on 2 different machines, with Microsoft USB wheel mouse on both. When rapidly scrolling, I realized that I was pressing down on the scroll wheel and "clicking" the scroll wheel. And those scroll wheel click events implement some function assigned to that event - I am not sure what in this case. Since I have been careful to not click the scroll wheel while scrolling, I have not seen the problem.
To build upon comment #5, I have seen the same problem. In my case, you can tell a 'phantom' paste will happen when you click the paste icon or enter <control v> and nothing happens. The next time you invoke the paste function it is executed at the current cursor position which is what you want but at a random location there is a copy of what you just pasted. My work-around for now is, if you paste and nothing happens, immediately hit 'Undo' to remove the Phantom Paste. Incidently, I am running on RHEL 5.2 with Gnome 2.16 and GEdit 2.16. This is on old CyberResearch pc with a Dell wheel mouse. My Dell Latitude w/Logitech wheel mouse and Redhat Scientific Linux 5.0 kernel 2.6.18 with Gnome 2.16 , GEdit 2.16 works just fine, never had this problem.
we've had no further reports of this and reading the comments above it looks like it aslo happened with geany etc... I guess that maybe it was a bug in old versions of gtk or X etc.
The phantom edits were due to a 'sick' mouse. Replaced the mouse and the problem went away.
I have this bug too for a long time with gedit, and I still have it with gedit 2.28.0, Gnome 2.28.1 and Ubuntu 9.10. I don't encounter this bug with other programs that gedit. As described, Ctrl+V sometimes pastes in a random location, so if I don't see the string pasted, I must undo and paste again. Is there a way to provide more information for this particular bug, like some backtrace?
This bug also exists with the Bluefish editor. It is really annoying. In desperation I changed to the less convenient Adie editor which is NOT based on gtk but at least copy and paste works. The excuse of a "sick" mouse doesn't play out because, as noted above, non gtk based applications do not experience this problem. I'm using gtk+-2.18.3