Page 1 of 1

Ctrl-n, Ctrl-p for navigation code completion menus

Posted: Thu Jun 13, 2013 8:07 pm
by dougemery
It would be very convenient if code completion menus could be navigated using Ctrl-n and Ctrl-p, in addition to the up/down-arrow keys. Ctrl-n would move to the 'next' item down the list; Ctrl-p would move the 'previous' item up the list.

This is the behavior found in Vim code completion menus, in emacs cursor movement between text lines, and in the navigation of search/URL completion in Safari and Chrome (and all Webkit based browsers?).

Thanks.
Doug

Re: Ctrl-n, Ctrl-p for navigation code completion menus

Posted: Tue Jun 18, 2013 5:38 pm
by adrian
Hello,

A keybindings/shortcuts profile for VIM would be required for this. Oxygen still accepts global shortcuts even when the focus is in the code completion menus. Ctrl+N is currently bound to File > New and Ctrl+P is bound to File > Print.

I have logged your request to our issue tracking tool.
This will be analyzed and if found appropriate, it will be implemented in a future version of Oxygen (long term).

Regards,
Adrian

Re: Ctrl-n, Ctrl-p for navigation code completion menus

Posted: Tue Jun 18, 2013 6:00 pm
by dougemery
adrian wrote:A keybindings/shortcuts profile for VIM would be required for this. Oxygen still accepts global shortcuts even when the focus is in the code completion menus. Ctrl+N is currently bound to File > New and Ctrl+P is bound to File > Print.
Ach, of course! In my Mac-centric way, I wasn't thinking that the Windows and Linux versions would have the usual Ctrl-N/P bindings.

Thanks for your quick response.

Re: Ctrl-n, Ctrl-p for navigation code completion menus

Posted: Fri Nov 20, 2015 1:49 am
by ottoh
Greetings,

The original request for this post is
dougmery wrote: (in base post #27204 of yr-2013)
It would be very convenient if code completion menus could be navigated using Ctrl-n and Ctrl-p, in addition to the up/down-arrow keys. Ctrl-n would move to the 'next' item down the list; Ctrl-p would move the 'previous' item up the list.
There is a related request found [forum post #1468, "Cursor Movement Accelerators] which states:
me wrote: (in base post #1468 of yr-2004)
I find myself constantly changing hand postions from the keyboard to the mouse to move the cursor between xml start and end tags. A keyboard accelerator that moves the cursor to just before the next ending tag would help tremendously. Something like CTRL-n.
(fyi -me is not my post, but someone with "me" as a poster name)

In my opinion a key issue is constantly changing hand positions from keyboard to the mouse to which I will also add from keyboard to an arrow key.

Movement between tags is a slightly different issue.

There was a follow on request
bsetzer wrote: (in yr-2006 re base post #1468 of yr-2004)
I would like to second this query and extend the thought. It would be very helpful to have a shortcut key that would move the cursor past the next tag. This is especially useful when typing text between a pair of tags and then needing to move beyond the end tag to continue typing (e.g. <li><em>xxxx</em>yyyy</li>, moving from xxxx to yyyy).
to which the following was stated:
Radu wrote: (re above yr-2006)
This seams like an useful feature to have. I posted a bug so your request will be discussed and you will be notified as soon as we come to a decision.
Was there a decision made on this?
adrian wrote: (re base post #27204 of yr-2013)
A keybindings/shortcuts profile for VIM would be required for this. Oxygen still accepts global shortcuts even when the focus is in the code completion menus. Ctrl+N is currently bound to File > New and Ctrl+P is bound to File > Print.
I think the issue of "keybindings/shortcuts profile for VIM" is not the core issue.
adrian wrote: I have logged your request to our issue tracking tool.
This will be analyzed and if found appropriate, it will be implemented in a future version of Oxygen (long term).
What is the status of this evaluation?

I believe that there is an important underlying issue that resolves the above and a multitude of other potential requests and already exists !

Core issue: provide extensive access to the code function call to the Menu Shortcut Keys mapper.

Fundamentally an event, a keystroke, is received, which is then mapped to a function call, which implements the users request.

In the request for movement in the code completion menus, there exists some code functionality that receives the movement of the <key-arrow-up> or <key-arrow-down> (a general keyboard event) and recoginzes the context (the code completion menu) and calls the appropriate function to effect the selection movement within the completion menu.

All the functionality exists... (Obviously)

All the mapping exists... (PgUp key invokes OxygenXML-internal-code to move the view-port of currently active window context to view items occurring before the current view-port location)

What exists as a very limited subset, is USER mapping ability of keyboard event to function call via the Menu Shortcuts Keys.

Depending upon internal code modularity and methods of implmentation, these requests would be a very simple change to a single code file.

I did not say my context...

Code: Select all


  0         1          2          3
0123456789 0123456789 0123456789 0123456789
AA <para>text</para>
BA <
BB <pa
BC <para></para>
Cursor btwn------^^
Event sequencing line {ab} is line (a) after event (b)
1) Line AA: entered 'Key->' of closing tag, cursor at AA-26
2) Line BA: just finished typing 'Key-Enter' and 'Key-<', cursor at BA-11, menu appears
3) Line BB: just finished typing 'Key-p', 'Key-a', menu shows {para}, cursor at BB-13
4) Line BC: just finished typing 'Key-Enter' and the tag completes with its closing tag.
ARG... The cursor is now at BC-15 - For entry of an attribute.

There is no method of moving cursor one character to left without DE-HOMING hands to use an arrow key or the mouse.

If there was access to the cursor movement functions via the Menu Shortcut Key preference window, a user could map a key sequence to a function that is called for the 'Key-Arrow-Right'. Whether it be a user familiar key sequence like vi, emacs, or some other editor. Personally, having been fluent in vi and emacs, where I did not have to de-home hands off of the main portion of the keyboard, it would be so very productive to have the ability to map keys (far more than you currently offer).

Depending upon how the mapping were implemented, one could really have a whole MACRO functionality. That being mapping a single key to do several operations, not just one. A user could hit a key sequence and it would be as if they hit several keys.

This post grew far long than I expected. Bottom line is I think the functionality that several people have requested is potentially easy to implement. Furthermore, since this should really be an extension of existing functionality, the product testing should be limited in scope.

Best regards,
..Otto

Re: Ctrl-n, Ctrl-p for navigation code completion menus

Posted: Wed Nov 25, 2015 1:37 pm
by Radu
Dear Otto,

In the Oxygen contextual menu in the Go to category there is an action called Go after next tag which should do precisely what you want. You can also assign a keyboard shortcut to it in the Oxygen Preferences.

As a workaround, in the Oxygen Preferences->Editor / Content Completion page there is a "Position cursor between tags" checkbox which would completely avoid leaving the caret inside the element tag after you use the content completion window.

Regards,
Radu

Re: Ctrl-n, Ctrl-p for navigation code completion menus

Posted: Wed Dec 02, 2015 2:36 am
by ottoh
Thank you.
That will work well.
And I just found the API, which may address the "macro" functionality that I mentioned.

Best regards,
..Otto