Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Help text should leave current cell active #2633

Closed
michaelaye opened this issue Nov 30, 2012 · 10 comments
Closed

Help text should leave current cell active #2633

michaelaye opened this issue Nov 30, 2012 · 10 comments

Comments

@michaelaye
Copy link
Contributor

Currently (0.13.1), when executing a cell like this one to see the help text:
cmd?
will activate the help text sub-window, but it also will proceed to a new cell leaving the previous one in the notebook history with nothing else than the cmd? text inside.
Would it not be better if the cursor stays in the cell that created the help text, and, as a plus, even move the cursor one backwards, before the question mark, and select the question mark, so that the next text written will overwrite the question mark?

@takluyver
Copy link
Member

That would certainly be nice, but I think it's one of those things that's tricky to do well. The frontend doesn't know the meaning of what's in the cell, it just sends it to the kernel. And the kernel doesn't know about the frontend.

I guess it would be quite simple for the frontend to check if the code is a single line ending with a ?. But even there, you have to be careful:

f = f + 1    # What does this mean?

@ivanov
Copy link
Member

ivanov commented Nov 30, 2012

@michaelaye does Ctrl-Enter partially solve this for you? It'll keep the cursor in the same cell, execute it, and highlight all of the text in that cell. That last part might not be something that you want, though.

Also, you're doing x? where x is a callable, you can also just type x(<tab> to get its doc string to pop up.

@ivanov
Copy link
Member

ivanov commented Dec 1, 2012

To add to what @takluyver is saying - imagine doing a "Run all" for a notebook with many cells - you certainly don't want it to stop executing and leave active any cell where you happen to have left behind a ? query...

@michaelaye
Copy link
Contributor Author

But if my suggestion would work, there wouldn't be any left behind ? query... ;)

@michaelaye
Copy link
Contributor Author

Out of interest: Which part currently knows that the comment with an ending ? like the one given by @takluyver is not something to be sent to the help viewer? Because nothing bad happens with that...

@takluyver
Copy link
Member

See this function:
https://github.com/ipython/ipython/blob/master/IPython/core/inputsplitter.py#L208

(Note that whole area is due for rearrangement in PR #2447, and subsequent
work)

@Carreau
Copy link
Member

Carreau commented Dec 1, 2012

Le 1 déc. 2012 à 00:59, Paul Ivanov a écrit :

@michaelaye does Ctrl-Enter partially solve this for you? It'll keep the cursor in the same cell, execute it, and highlight all of the text in that cell. That last part might not be something that you want, though.

Also, you're doing x? where x is a callable, you can also just type x( to get its doc string to pop up.

it does not need to be a callable, [ numpy( will work, but don't tell anyone it's a feature not a bug ] but it is really useful .

As for leaving foo? I think it is a reason of consistency between frontend as you can't edit previous input in console.

Matthias


Reply to this email directly or view it on GitHub.

@takluyver
Copy link
Member

On Dec 1, 2012 9:41 AM, "Bussonnier Matthias" notifications@github.com
wrote:

As for leaving foo? I think it is a reason of consistency between
frontend as you can't edit previous input in console.

In some cases, though, it does put the last input at the next prompt, minus
the ?. That serves much the same purpose.

@ellisonbg
Copy link
Member

I do think it is probably important to be consistent with the behavior of
the terminal on this one. I also think that this is a perfect place to use
Ctrl-Enter. I guess I am just agreeing with what others have said.

Cheers,

Brian

On Sat, Dec 1, 2012 at 2:44 AM, Thomas Kluyver notifications@github.comwrote:

On Dec 1, 2012 9:41 AM, "Bussonnier Matthias" notifications@github.com
wrote:

As for leaving foo? I think it is a reason of consistency between
frontend as you can't edit previous input in console.

In some cases, though, it does put the last input at the next prompt, minus
the ?. That serves much the same purpose.


Reply to this email directly or view it on GitHubhttps://github.com//issues/2633#issuecomment-10915796.

Brian E. Granger
Cal Poly State University, San Luis Obispo
bgranger@calpoly.edu and ellisonbg@gmail.com

@ellisonbg
Copy link
Member

The new modal UI changes all of this, not relevant any longer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants