Closed sglyon closed 9 years ago
Hm. Your changes do work for me, I think -- when focusing on the console pane the last input line is focused automatically (though I gotta admit I just typed the changes in instead of using your fork). I really like this change, btw!
Oh that's great.
How are you switching to the REPL pane?
Just clicking on the Console
tab or the pane does the trick. Haven't tried the shortcuts yet.
Shortcuts don't work. I think this is more of a problem with Atom than with your code though.
Yeah, so clicking the mouse should have already been working from these lines.
What I'm going for here is auto focus on input line when I move to the REPL pane via keyboard shortcuts.
I can't get that to work
Those lines wouldn't focus the editor when clicking on the pane though, right? And it doesn't work without your fix, so I think it does something ;)
Nice, well glad it is doing something.
If you have any ideas about how to get it to work when using keyboard shortcuts I'm open to suggestions.
Nice, that worked!
I have rebased and left only the commit that wraps in setTimeout
Awesome, glad to have the patch!
Just a heads up
So this trick only works when we keep the REPL in the pane we create for it.
If we move the REPL to a different pane (e.g. next to the editor, instead of below it), the onDidActivate
callback we rely on here doesn't apply to the new pane and we don't get auto-focus on input line when moving to the pane with the REPL
I'm trying to figure out how to focus on the input line whenever the pane holding the console becomes active.
To do this I modified
openInTab
to register a callback with the new pane it creates. This callback should call thefocusInput
method on the view whenever the pane becomes active.I modified
focusInput
to have it log when the function is called, and when it properly finds the lastatom-text-editor
.From the console log it seems like the function is being called whenever the pane becomes active, but I still can't
focus
on the input line.Any suggestions? When we figure this out we will just wipe these commits and start a fresh PR.