Permalink
Browse files

correct logic for determining whether there is a selection prior to c…

…ode execution
  • Loading branch information...
1 parent 20966b7 commit 6c6c995212d3cefab4d34d3ba70b2a65289f8828 @jjallaire jjallaire committed Mar 28, 2013
@@ -1693,7 +1693,8 @@ void onExecuteCode()
docDisplay_.focus();
Range selectionRange = docDisplay_.getSelectionRange();
- if (selectionRange.isEmpty())
+ boolean noSelection = selectionRange.isEmpty();
+ if (noSelection)
{
int row = docDisplay_.getSelectionStart().getRow();
selectionRange = Range.fromPoints(
@@ -1704,7 +1705,7 @@ void onExecuteCode()
executeRange(selectionRange);
// advance if there is no current selection
- if (selectionRange.isEmpty())
+ if (noSelection)
{
if (!docDisplay_.moveSelectionToNextLine(true))
docDisplay_.moveSelectionToBlankLine();

0 comments on commit 6c6c995

Please sign in to comment.