Skip to content

Commit

Permalink
Alt + Enter sends current line to FSI if there is no selection
Browse files Browse the repository at this point in the history
fixes #256
closes #257

commit 9388cbb
Author: Anh-Dung Phan <[email protected]>
Date:   Fri Feb 20 21:53:51 2015 +0000

    Remove an unused variable

commit 4ad5026
Author: Anh-Dung Phan <[email protected]>
Date:   Fri Feb 20 19:41:24 2015 +0000

    Alt + Enter sends current line to FSI if there is no selection
  • Loading branch information
dungpa authored and latkin committed Feb 20, 2015
1 parent 3faba92 commit ac32717
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -421,12 +421,7 @@ protected virtual int QueryCommandStatus(ref Guid guidCmdGroup, uint nCmdId) {
{
if (nCmdId == (uint)Microsoft.VisualStudio.VSConstants.VSStd11CmdID.ExecuteSelectionInInteractive)
{
string selection;
this.textView.GetSelectedText(out selection);
if (selection == "")
return (int)OLECMDF.OLECMDF_SUPPORTED;
else
return (int)OLECMDF.OLECMDF_SUPPORTED | (int)OLECMDF.OLECMDF_ENABLED;
return (int)OLECMDF.OLECMDF_SUPPORTED | (int)OLECMDF.OLECMDF_ENABLED;
}
else if (nCmdId == (uint)Microsoft.VisualStudio.VSConstants.VSStd11CmdID.ExecuteLineInInteractive)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ module internal Hooks =

command.Supported <- true
command.Visible <- looksLikeFSharp
command.Enabled <- if selectLine then true else haveSelection
command.Enabled <- true

let mutable private hasBeenInitialized = false

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -454,17 +454,17 @@ type internal FsiToolWindow() as this =
// Change post CTP.
let dte = provider.GetService(typeof<DTE>) :?> DTE
let activeD = dte.ActiveDocument
match dte.ActiveDocument.Selection with
match activeD.Selection with
| :? TextSelection as selection when selectLine || selection.Text = "" ->
selection.SelectLine()
showNoActivate()
executeInteraction (System.IO.Path.GetDirectoryName(activeD.FullName)) activeD.FullName selection.TopLine selection.Text
// This has the effect of moving the line and de-selecting it.
selection.LineDown(false, 0)
selection.StartOfLine(vsStartOfLineOptions.vsStartOfLineOptionsFirstColumn, false)
| :? TextSelection as selection ->
let origLine = selection.CurrentLine
if selectLine then
selection.SelectLine()
showNoActivate()
executeInteraction (System.IO.Path.GetDirectoryName(activeD.FullName)) activeD.FullName selection.TopLine selection.Text
if selectLine then
// This has the effect of moving the line and de-selecting it.
selection.LineDown(false, 0)
selection.StartOfLine(vsStartOfLineOptions.vsStartOfLineOptionsFirstColumn, false)
| _ ->
()
with
Expand Down

0 comments on commit ac32717

Please sign in to comment.