Skip to content

Commit 4fa5cfc

Browse files
Merge pull request #467 from Matt-17/master
Added Write without new line to OutputWindowPane
2 parents cb2f77d + f30bbc5 commit 4fa5cfc

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

src/toolkit/Community.VisualStudio.Toolkit.Shared/Helpers/OutputWindowPane.cs

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,18 @@ public void WriteLine(string value)
236236
});
237237
}
238238

239+
/// <summary>
240+
/// Writes the given text to the Output window pane.
241+
/// </summary>
242+
/// <param name="value">The text value to write.</param>
243+
public void Write(string value)
244+
{
245+
ThreadHelper.JoinableTaskFactory.Run(async () =>
246+
{
247+
await WriteAsync(value);
248+
});
249+
}
250+
239251
/// <summary>
240252
/// Writes a new line to the Output window pane.
241253
/// </summary>
@@ -249,6 +261,15 @@ public Task WriteLineAsync()
249261
/// </summary>
250262
/// <param name="value">The text value to write. May be an empty string, in which case a newline is written.</param>
251263
public async Task WriteLineAsync(string value)
264+
{
265+
await WriteAsync(value + Environment.NewLine);
266+
}
267+
268+
/// <summary>
269+
/// Writes the given text to the Output window pane.
270+
/// </summary>
271+
/// <param name="value">The text value to write.</param>
272+
public async Task WriteAsync(string value)
252273
{
253274
await ThreadHelper.JoinableTaskFactory.SwitchToMainThreadAsync();
254275

@@ -261,11 +282,11 @@ public async Task WriteLineAsync(string value)
261282

262283
if (_pane is IVsOutputWindowPaneNoPump nopump)
263284
{
264-
nopump.OutputStringNoPump(value + Environment.NewLine);
285+
nopump.OutputStringNoPump(value);
265286
}
266287
else
267288
{
268-
ErrorHandler.ThrowOnFailure(_pane.OutputStringThreadSafe(value + Environment.NewLine));
289+
ErrorHandler.ThrowOnFailure(_pane.OutputStringThreadSafe(value));
269290
}
270291
}
271292

0 commit comments

Comments
 (0)