Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 315654 - [console] Position at end of line after Page-Up/Down
Summary: [console] Position at end of line after Page-Up/Down
Status: CLOSED FIXED
Alias: None
Product: OCL
Classification: Modeling
Component: Core (show other bugs)
Version: 3.0.0   Edit
Hardware: PC Windows Vista
: P3 minor (vote)
Target Milestone: 3.1.0   Edit
Assignee: OCL Inbox CLA
QA Contact:
URL:
Whiteboard: Usability
Keywords:
Depends on:
Blocks: 318358
  Show dependency tree
 
Reported: 2010-06-03 15:16 EDT by Ed Willink CLA
Modified: 2011-05-27 03:13 EDT (History)
1 user (show)

See Also:
ed: indigo+


Attachments
cursor to EOL and initial selection fix (4.37 KB, patch)
2011-03-05 01:46 EST, Ed Willink CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ed Willink CLA 2010-06-03 15:16:01 EDT
The cursor is currently positioned at the beginning of a line after Page-Up.

Since it is usually the intent just to re-execute, an Enter corrupts the display.

Put cursor at End-Of-Line.
Comment 1 Ed Willink CLA 2011-03-05 01:46:59 EST
Created attachment 190463 [details]
cursor to EOL and initial selection fix

A retrofit fix from the Xtext console

a) PageUp/Down now positions at end of line

b) On start up the selectionService fails to provide the prevailing selection, so it now searches for a selection in the active editor.

b) is better but perhaps not entirely right; watching the status bar feedback, the problem is perhaps that console creation trashes the selection, so while the fix ensures that selection is available for the first expreession, the status bar remains blank till a new selection is made.
Comment 2 Axel Uhl CLA 2011-03-14 05:12:25 EDT
Hi Ed,

I've looked at the patch. Debugging through the code I see that the change should work. I recommend factoring the common pieces

    String newText = history.get(currentHistoryPointer);
    document.set(newText);
    input.setSelectedRange(newText.length(), 0);

into a method that you call from the three locations where this code stretch occurs.

I've never actively been using the OCL console, and if, I was confused by its usability. The patch is certainly helpful. At the same time, depending on what we decide the future of the console should be, we really should revise it from a usability point of view. Why doesn't it show the entered text in the input field and lets the user navigate around with regular cursor keys, including cursor up/down/left/right? It doesn't seem intuitive to me that I have to press PageUp to get the the last expression where every other console would just use Up for this.

+1 for this with the recommendation to factor as described above, and I'll open another bug regarding my general usability concerns regarding the console.
Comment 3 Ed Willink CLA 2011-03-14 06:35:47 EDT
setTextFromHistory() introduced.

Committed to HEAD for M6.
Comment 4 Ed Willink CLA 2011-05-27 03:13:32 EDT
Closing