rstudio/rstudio — pull request #79 by justacec (2013-12-22 16:04:52+00:00)
Title: Justacec/code block

I have been wanting to have the ability to execute the code contained in a section. Currently I have to highlight the code I want to execute and then hit the execute button. While this works it is time consuming. Additionally, organizing an analysis into logical blocks (sections) that correspond to different phases of the analysis is very convenient and has proven to be very productive in Matlab.

In this implementation, if the cursor is positioned inside a valid code block and the "Run Code Section" menu option is selected, R will execute the code inside the bounds of the current section (the section that contains the active cursor). The action can also be initiated by using the "Alt+Enter" hotkey which is similar to the "Command+Enter" hotkey for a single line or a selected block. I have also added an icon to the icon bar just above the editor to highlight this new feature.

In this discussion a code section is defined by the standard "## ----" format.