Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
DedSec256 committed Mar 3, 2023
1 parent 6244744 commit 260e80d
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,8 @@ type FSharpReformatCode(textControlManager: ITextControlManager) =
sourceFile.GetPsiServices().Files.CommitAllDocuments()
with _ -> ()
else
let textControl = textControlManager.VisibleTextControls |> Seq.tryFind (fun c -> c.Document == document)
let textControl = textControlManager.VisibleTextControls
|> Seq.tryFind (fun c -> c.Document == document && c.Window.IsFocused.Value = true)
let cursorPosition = textControl |> Option.map (fun c -> c.Caret.Position.Value.ToDocLineColumn())
let formatResult = fantomasHost.FormatDocument(filePath, text, settings, parsingOptions, newLineText, cursorPosition)
let newCursorPosition = formatResult.CursorPosition
Expand Down

0 comments on commit 260e80d

Please sign in to comment.