[This topic is migrated from our old forums. The original author name has been removed]
I've been having this problem for quite some time, but it's taken me ages to figure out how to reproduce it consistently. The symptoms are as follows: I want to replace a bit of text in a SQL script using copy-and-paste. I double-click to select the text to be replaced. The desired text becomes highlighted BUT the cursor ends up on the line below the selected text. If I'm not paying attention, the pasted text is placed into the wrong line and my selection is unchanged.
After much testing it appears that it happens when I have my arrow cursor near the bottom of the word when I double-click to select text. On the first click of the mouse the cursor gets moved to the line below the word I'm selecting, while the second click selects the desired word. The funny thing is, this ONLY happens when I'm selecting text on the line just ABOVE the last line in the editor (ie. the second-to-last line).
I'm unable to reproduce the problem on any other line. On other lines the cursor ends up at the end of the selection (which is the desired result), BUT what's also funny is that when I double-click a word on the last line in the editor the cursor ends up at the point where I double-clicked, not at the end of the selection.
I've reproduced this on both a Mac and a Windows XP machine, so it's not OS-specific.