This Bugzilla instance is deprecated, and most Eclipse projects now use GitHub or Eclipse GitLab. Please see the deprecation plan for details.
Bug 362107 - Ctrl-Up/Down does not work properly
Summary: Ctrl-Up/Down does not work properly
Status: RESOLVED FIXED
Alias: None
Product: Orion (Archived)
Classification: ECD
Component: Editor (show other bugs)
Version: unspecified   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 0.4 M1   Edit
Assignee: Felipe Heidrich CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-10-26 13:11 EDT by Mihai Sucan CLA
Modified: 2011-12-01 17:00 EST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mihai Sucan CLA 2011-10-26 13:11:16 EDT
STR:
1. Open a file in Orion with several lines.
2. Go to one of the middle lines, in the middle of the said line.
3. Press Ctrl-Up/Down several times.
4. Press any arrow key now, without holding Ctrl.

Notice that when Ctrl-Up/Down is used the line highlight goes away. When you start doing other caret navigation operations (with the arrow keys), the old caret location is used as the start point (same as in point 2).

It looks like the native caret moves, but not that of Orion, hence the breakage. Should be easy to fix.

Please note this is for Linux users only. On Windows Ctrl-Up/Down does nothing (as expected). Someone with a Mac should check the expected behavior.
Comment 1 Mihai Sucan CLA 2011-10-28 05:49:14 EDT
Just found that this bug is somewhat related to bug 347348. That is, I assume, for Windows users. This bug is for Linux users, so there shouldn't be a conflict between the two reports.
Comment 2 Mihai Sucan CLA 2011-10-28 09:10:40 EDT
Proposed fix:

https://github.com/mihaisucan/orion.client/tree/bug-362107

Additional comment: in doLineUp/Down there's a check that resets the X column if x == -1 || args.select and now I added args.wholeLine. Still, I believe we should remove args.select. When the user is selecting the X column caret location is never remembered, it's always updated. Compared to other editors (gedit on Linux) this behavior is different. Gedit maintains the X column caret location even during selection. Any thoughts on this?

(I haven't tested on other systems...)
Comment 3 Silenio Quarti CLA 2011-11-02 12:23:40 EDT
I think we should test this on firefox/chrome on linux and mac, and firefox/chrome/ie on windows before removing the code.

On Windows, IE will reset columnX during selection (tested on notepad/wordpad/ie textarea), Firefox does not reset the columnX (tested on Firefox textarea).


I will try to test all the cases after lunch.
(signed Felipe, using Silenio's machine. https://bugs.eclipse.org/bugs/show_bug.cgi?id=362428#c2 it was also me, sorry for the confusion).
Comment 4 Felipe Heidrich CLA 2011-11-02 16:19:57 EDT
I tested on all the places, basically:

The columnX is only reset on IE.

Ctrl-Up/Down - is only implemented for Firefox on Linux, and on my machine (fedora 14, firefox 7.0.1) it is the same regular up/down (not resetting columnX).
Comment 5 Mihai Sucan CLA 2011-11-03 08:51:15 EDT
Hello Felipe!


(In reply to comment #4)
> I tested on all the places, basically:
> 
> The columnX is only reset on IE.

Ok, so this means Orion shouldn't reset columnX in all cases except IE. Do you want to special-case IE? That's fine by me.

I think columnX during selection should not be reset.


> Ctrl-Up/Down - is only implemented for Firefox on Linux, and on my machine
> (fedora 14, firefox 7.0.1) it is the same regular up/down (not resetting
> columnX).

Yep, only Firefox on Linux. But editors on Linux also have Ctrl-Up/Down.

I am not sure what would be most-wanted in Orion? Compat with Firefox or with editors on Linux? I picked compat with editors, since Orion is an editor.

Either way, it's fine for me, as long as the Ctrl-Up/Down breakage is fixed in Firefox on Linux.

Thank you for your testing and for checking the patch. Much appreciated!
Comment 6 Felipe Heidrich CLA 2011-11-10 15:01:53 EST
fixed
http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=6eeb751f99b59063a9d948bc8eeba5be896c3423

changes:
- reset columnX during selection only for IE 
- fix ctrl+up/down for firefox on linux 
- added more key bindings for mac: 
opt+up/down - linestart/lineend (broken on safari and chrome)
opt+shift+up/down - select linestart/lineend (broken on safari and chrome)
ctrl+left/right - linestart/lineend (broken on safari and chrome)
ctrl+shift+left/right - select linestart/lineend (broken on safari and chrome)
ctrl+up/down - scroll page up/down
Comment 7 Mihai Sucan CLA 2011-11-11 14:37:43 EST
Felipe: thanks for your patch that fixes this bug and brings more keybindings for Mac users.
Comment 8 Mihai Sucan CLA 2011-11-21 15:42:31 EST
(In reply to comment #6)
> fixed
> http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=6eeb751f99b59063a9d948bc8eeba5be896c3423

There's a regression caused by this patch. Found this with the Firefox automated test for bug 360726.

Ctrl-Shift-Down no longer works as it was supposed to: columnX is not always reset and wholeLine has no effect after several presses. This means that most of the times selection is not extended until the end of the line.

Fix pushed:

http://git.eclipse.org/c/orion/org.eclipse.orion.client.git/commit/?id=0a39919753d45bf9b41a1a326bbcf756ad976244

(I hope this is fine!)
Comment 9 Felipe Heidrich CLA 2011-11-21 15:51:35 EST
Ops

Thank you for the fix