Bug 389493 - [typing] Text Paste without cursor movement
Summary: [typing] Text Paste without cursor movement
Status: ASSIGNED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: Text (show other bugs)
Version: 3.7.2   Edit
Hardware: All All
: P5 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Platform-Text-Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: helpwanted
Depends on:
Blocks:
 
Reported: 2012-09-13 07:29 EDT by Wim Jongman CLA
Modified: 2012-09-21 07:10 EDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wim Jongman CLA 2012-09-13 07:29:51 EDT
I often have the need to insert text without the cursor moving to the end of the just inserted text. 

My recent experience is explaned next, but I experience it in many other situations as well.


Suppose the following use case where I have a bunch of javadoc text:

@see #Constant1
@see #Constant2
@see #Constant3
@see #Constant4
@see #Constant5

now I want to replace # with LongClassName. I have LongClassName. on my clipboard, i move the cursos to the first #, press backspace and CTRL+V

The result is this:

@see LongClassName.|Constant1
@see #Constant2
@see #Constant3
@see #Constant4
@see #Constant5

The cursor position is after the just inserted text. If I want to replace the next # then I need to do a lot of keystrokes to get to the correct position. 

The result is that I accept this or open the Find/Replace dialog. I often don't want to do that because it breaks my contact with the keyboard (mouse action required.)

Is there a way to let the cursor stay in its place so that the insert would give me:

@see |LongClassName.Constant1
@see #Constant2
@see #Constant3
@see #Constant4
@see #Constant5
Comment 1 Dani Megert CLA 2012-09-13 07:56:11 EDT
(In reply to comment #0)
> The result is that I accept this or open the Find/Replace dialog. I often
> don't want to do that because it breaks my contact with the keyboard (mouse
> action required.)

Why do you need the mouse for that?


> Is there a way to let the cursor stay in its place so that the insert would
> give me:
> @see |LongClassName.Constant1
> @see #Constant2
> @see #Constant3
> @see #Constant4
> @see #Constant5

No.
Comment 2 Wim Jongman CLA 2012-09-13 08:27:16 EDT
> > action required.)
> 
> Why do you need the mouse for that?

You are right. I could do that without the mouse. However, the dialog is mouse oriented. I could get away with tabbing and key movement (for example, try to change the button focus from "Replace" to "Replace All".) Reducing keystrokes is why I filed this.
Comment 3 Markus Keller CLA 2012-09-21 05:58:40 EDT
(In reply to comment #0)
The quickest way to achieve that is to use block selection mode:
- Toggle Block Selection (Alt+Shift+A)
- Shift+<5*Down>
- Ctrl+V
- Alt+Shift+A
Comment 4 Wim Jongman CLA 2012-09-21 07:10:40 EDT
(In reply to comment #3)
> (In reply to comment #0)
> The quickest way to achieve that is to use block selection mode:
> - Toggle Block Selection (Alt+Shift+A)
> - Shift+<5*Down>
> - Ctrl+V
> - Alt+Shift+A

Thanks Markus that is already better. 

I am happy to make a little prototype. Could you point me to some interesting classes I could look at. For example, the one that does normal paste?