PythonScript icon indicating copy to clipboard operation
PythonScript copied to clipboard

[Enhancement] Add "To Editor" context-menu command

Open Yaron10 opened this issue 7 years ago • 12 comments

STR: Run in the console: editor.gotoPos(1).

Result: You can not see the position unless you close "Python". (Clicking in the editor is obviously not a good option in this case).

Suggestion: Add "To Editor" (or "Focus Editor") command to the output context-menu.

Thank you.

Yaron10 avatar Jul 27 '18 13:07 Yaron10

Just an aside: My workaround for this came via Claudia a long time ago: 3 keystrokes: Alt+w, w, Enter :)

sasumner avatar Jul 27 '18 13:07 sasumner

Thank you Scott.

More complex if NPP interface language is not English. Anyway, a command (+ a keyboard shortcut) would make it much easier.

Yaron10 avatar Jul 27 '18 13:07 Yaron10

I think one of the problems is that some keyboard shortcuts don't work when you are in the PS console...don't know how easy that would be to change.

Example, have input focus on the >>> box. Press any keycombo you would see on the Plugins->PS menu (don't do it via the menu, of course)...nothing happens.

I'm thinking that our friendly PS developers may not have easy control over setting up a keycombo to do your desired functionality. Am I thinking about this correctly?

sasumner avatar Jul 27 '18 13:07 sasumner

Press any keycombo you would see on the Plugins->PS menu

I haven't assigned any shortcuts to PS. But Ctrl+N (for example) is not supposed to work when the console has the focus. Neither does it work if the Incremental Bar's EditBox has the focus.

But I think that assigning a shortcut to the output context-menu command should be possible. Making it work also in the input field is probably more complex. Let's wait for CF. :)

Yaron10 avatar Jul 27 '18 14:07 Yaron10

@Yaron10 I thought I understood your original example enough to know what you were getting at. Now that I try it, I don't understand your "You can not see the position..."...because I can see it. Maybe help me understand a bit more about this specific thing you are seeing when you do it?

sasumner avatar Jul 28 '18 11:07 sasumner

Scott,

STR: Place the caret at the top of the file (position 0). Run in the console: editor.gotoPos(1).

Result: The caret is in the input field and you can not see the position in the file unless you close "Python".

Can you?

Yaron10 avatar Jul 28 '18 12:07 Yaron10

@Yaron10 Okay, now I understand. I don't see the caret, but my viewport is scrolled to "see" the position. Meaning if I am on line 9999 in my file, after the command I can see line 1. True that I cannot see a caret, which is, I'm now confident, what you mean by "see the pos".

sasumner avatar Jul 28 '18 13:07 sasumner

Meaning if I am on line 9999 in my file, after the command I can see line 1.

I assumed that's what you meant in your previous post. :) And that's why I changed the STR to "pos0 -> pos1".

Yaron10 avatar Jul 28 '18 13:07 Yaron10

Scott,

How about moving focus to the editor on Ctrl+Run? (In addition to the menu command).

Yaron10 avatar Jul 28 '18 18:07 Yaron10

How about moving focus to the editor on Ctrl+Run

OK with me. :)

sasumner avatar Jul 28 '18 19:07 sasumner

Great. Thank you.

Yaron10 avatar Jul 28 '18 19:07 Yaron10

What about SCI_GRABFOCUS? Guessing this would be something like editor.grabFocus() in PythonScript?

dail8859 avatar Sep 12 '18 22:09 dail8859