Thanks for the feedback and sorry this is so painful for you.
When you highlight a selection and accidentally delete it by
pressing another key, is it not enough to perform edit |
undo once to get your code back? Also to save time, I'd
personally suggest using the shortcut Ctrl+Z to
quickly undo any mistakes rather than using the menu item.
Either way, this isn't a solution for problem (just trying to
clarify what is going on). We've got a feature request to toggle
the focus after a run to either the console of the source.
Originally, we actually had it as you suggested (place focus in the
console after a run), but got a lot of negative feedback on this
due to the majority of users working primarily in the source
(editing, running, and editing again all in the source rather than
the console). This was for reproducibility purposes as well as ease
As you've suggested, I'll chalk up another request on this
feature suggestion to allow the user to choose the behavior. Also
one for placing the undo button on the menu.
3 Posted by Jonathan Callahan on 13 Jul, 2012 04:53 PM
Thanks for the quick response and for the Ctrl+Z hint. This shortcut is
way more efficient than clicking on any button.
But just FYI, I need to Ctrl+Z once for each character I have typed rather
than once for the entire chunk. I believe I saw mention of this as being
dependent upon your use of the Ace editor.
And it's interesting to hear that most people stay in the source window.
I'm always bouncing back and forth, especially when I'm trying to debug
some source code. In that scenario I will highlight and run in the source
and then go into the console to examine various results, then highlight and
run some more as I work my way through a file. Poor mans' break points!
Keep up the good work with Rstudio. Despite my suggestion I love what you
Thanks for following up and I see what you mean by having to
undo each character you've typed after the
deletion. Thus, this just depends on how much you've typed before
you realize it's deleted your selection. For example:
start typing: "foo <- "
realize you've deleted your code
undo 7 times
(Also yes, we use ACE for our editor)
Finally, I guess everyone has different working habits and I'd
assume everyone jumps back and forth between the console at some
point. Perhaps some just work in the source more than others.
Either way, I've got the feature suggestion and thanks for the
addition push for this.
Josh Paulson closed this discussion
on 13 Jul, 2012 05:11 PM.
Jonathan Callahan re-opened this discussion
on 18 Jul, 2012 06:35 PM
5 Posted by Jonathan Callahan on 18 Jul, 2012 06:35 PM
One quick note on this topic. I hadn't realized that Ctrl+Z was listed in
the Edit menu whereas "Clear console" does list Ctrl+L. It might be time
to go through those menus and make sure that all shortcuts are listed.
Thanks for the heads up and this is actually just a QT thing.
Unfortunately, we can't do anything about this right now. As far as
I know, we've got the shortcuts listed for everything we can. The
ones that have problems with QT are cut, copy, paste, undo, redo,
We've recently implemented this feature and now we've done two
1) Given the option to place focus into the console after
executing lines of code from the source
2) Remove the selection after highlighting and running multiple
lines from source
Both of these are aimed at removing the possibility of
overwriting code after running a selection. This will be available
in the next version of RStudio (v0.97) or if you want this feature
now, you can download the latest daily: