Closed spyder-bot closed 9 years ago
From ccordoba12 on 2013-12-11T17:37:05Z
I also need this sometimes. Maybe we could make F9 to do this by default.
Status: Accepted
Labels: Cat-Editor MS-v2.3.1
From bl83...@gmail.com on 2014-01-30T09:41:51Z
agreed it would be very useful thks
From geotheo...@gmail.com on 2014-03-11T06:26:44Z
I couldn't concur more. Simple things like this really improve UX.
From robro...@gmail.com on 2014-03-11T21:34:28Z
It might be easy... Spyder already has a method to get the current line. See: https://bitbucket.org/spyder-ide/spyderlib/pull-request/28/issue-1670-run-current-line-if-no/diff
From robro...@gmail.com on 2014-03-12T09:16:35Z
Hmm after some sleep, I realized that I'm just not completely comfortable with modifying get_selection_as_executable_code
to let it return code that's not actually from a selection.
What would you suggest?
From contrebasse on 2014-03-13T17:33:56Z
Blind suggestion: have the function select the line before execution.
From nin...@gmail.com on 2014-03-20T03:37:44Z
Definitely +1. To avoid being a totally useless comment, I'd vote not to change the behavior for F9 (run selection), but rather add a new hotkey (F10 or whatever) for the functionality. Or F9 handler could check if a global option was set to change F9 from default behavior i.e. :
if (OPTIONS.F9_RUN_CURRENT_LINE): text = self.get_current_line() else:
From mayou...@gmail.com on 2014-04-20T04:57:32Z
Hi there,
The amended source code works good. Thank you so much. May I suggest something ? When we press F9, the cursor place changes and go in the console window, which forces us to click again in the editor to use F9 again.
Maybe it would be good if the cursor stay in the editor and go in the next line, after the one executed.
Thank you
From heshr...@gmail.com on 2014-08-06T08:13:42Z
Hi all,
Is the feature already built in Spyder? How can I get the run-line-without-selection to work?
Totally agree with the #9
comment. Please implement it in such a way that after completion the cursor remains in the editor.
Alternative suggestion- Ctrl+Enter can be used to run a line when nothing is selected. And this wouldn't interfere with the current behavior of F9. Ctrl+Enter is the hotkey in most editors that have this feature.
Thanks.
From ccordoba12 on 2014-08-06T11:00:06Z
There are two things here:
I'll try to solve this for 2.3.1
From ccordoba12 on 2014-08-06T11:02:33Z
I forgot to mention that staying in the Editor is part of a pull request I hope to merge soon.
From ccordoba12 on 2014-08-17T09:44:26Z
This issue was closed by revision 5f4e47ead5cc .
Status: Fixed
From ccordoba12 on 2014-08-17T09:46:55Z
Ok, now F9 runs the current line if nothing is selected. Besides, focus remains on the Editor when running lines, selections or cells.
Why can I not associate CTRL + ENTER for this feature? (I mean I can in preferences, but it doesn't work.)
Ctrl+Enter
is reserved to run cells, as in the Jupyter notebook.
That is hard coded? Why not allow it to be bound to other things if it is not a cell. Seems to me this would make ctrl+enter
more consistent, no? Like this:
For consistency with similar platforms, F9 must skip to the next line if no text is selected.
An option to overload the ctrl+enter
would be nice too. That way Jupyter users keep their consistency and RStudio users get their way.
F9
will move to the next line in our next release (Spyder 3.0). About Ctrl+Enter
, please open a new issue about it, this one is closed :-)
New issue is thus made: https://github.com/spyder-ide/spyder/issues/3395
ctrl+Enter shortcut wouldbe better for this.
ctrl+Enter is better for this .. much much better than F9.
It's better for Rstudio people because they are accustomed to it :-)
But we're going to provide an Rstudio shortcut set in Spyder 3.1.
Where can I find the Rstudio shortcut set in Spyder 3.2.4?
Sorry, we haven't had time to implement it. That's going to be available in Spyder 4, to be released next year.
Ok, I look forward to it 👍
Hi,
If you guys could go beyond F9 for current line and have it more like RStudio's ctrl+enter which runs the next command I would be very grateful.
Running 1 line at a time means any commands or functions that go over one line need to be highlighted and selected manually to run (unless you wrote the code with sufficient number of cells).
Thanks so much! Kirk
@kgeier, that is what cells are for. You can create a cell (which is a block of code that can be evaluated independently) by adding a comment of the form #%%
in your code file. Then, after pressing Ctrl+Enter
(run cell and stay in the current cell) or Shift+Enter
(run cell and advance), that block will be sent to the console.
Hi Carlos, Yes thank you. Cells is definitely better than nothing but if trying to run someone else's code that hasn't been written with cells it's a little less clear and more work. However I understand if you guys have other priorities.
Thanks!
We'll try to improve the line-by-line evaluation model in Spyder 4.
I'm not sure if I've missed this, but is there a date for deployment of Spyder 4 in Anaconda?
January of 2019. We can't be more specific right now, sorry.
Is the run-current line function available in the Spyder 4 beta?
No, not yet.
From giz...@gmail.com on 2013-12-07T07:32:28Z
Hello Spyder Devs
I often want to simply run the current line (i.e. the line under my cursor), and its a little cumbersome to first highlight it and then execute "Run Selection" Thanks for your hardwork.
Original issue: http://code.google.com/p/spyderlib/issues/detail?id=1670