File tree Expand file tree Collapse file tree 2 files changed +3
-3
lines changed
module/PowerShellEditorServices/Commands/Public Expand file tree Collapse file tree 2 files changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -155,7 +155,7 @@ function New-EditorFile {
155155 }
156156
157157 $psEditor.Workspace.OpenFile ($fileName , $preview )
158- $editorContext .CurrentFile.InsertText (($valueList | Out-String ))
158+ $psEditor .GetEditorContext () .CurrentFile.InsertText(($valueList | Out-String ))
159159 } else {
160160 $PSCmdlet.WriteError ( (
161161 New-Object - TypeName System.Management.Automation.ErrorRecord - ArgumentList @ (
@@ -167,7 +167,7 @@ function New-EditorFile {
167167 }
168168 } else {
169169 $psEditor.Workspace.NewFile ()
170- $editorContext .CurrentFile.InsertText (($valueList | Out-String ))
170+ $psEditor .GetEditorContext () .CurrentFile.InsertText(($valueList | Out-String ))
171171 }
172172 }
173173}
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ function Out-CurrentFile {
2626
2727 try {
2828 # If there is no file open
29- $psEditor.GetEditorContext ()
29+ $null = $ psEditor.GetEditorContext ()
3030 }
3131 catch {
3232 # create a new one
You can’t perform that action at this time.
0 commit comments