Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix typos #3547

Merged
merged 1 commit into from
Jan 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions PSReadLine/Changes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

### [2.2.5] - 2022-05-03

- Re-package the `2.2.4-beta1` version to `2.2.5` as an offical servicing release.
- Re-package the `2.2.4-beta1` version to `2.2.5` as an official servicing release.

[2.2.5]: https://github.com/PowerShell/PSReadLine/compare/v2.2.4-beta1...v2.2.5

Expand Down Expand Up @@ -385,7 +385,7 @@ Bug fixes:
* Fix InvokePrompt when the prompt is > 1 line.
* Fix YankToPercent off by 1 error.
* Fix error reported when running in container.
* Catch and ignore execptions in InvokePrompt (#583)
* Catch and ignore exceptions in InvokePrompt (#583)
* Get new completions on 2nd tab if 1st had 1 result (#238)
* Tab replaced with 4 spaces during paste (#144)
* Fix rendering after buffer resize (#418)
Expand Down Expand Up @@ -670,7 +670,7 @@ New features:
* Add ETW event source for demo mode, key logger, macro recorder etc.
* Undo/redo
* Get-PSReadLineOption cmdlet
* Make specifying key handlers for builtins simpler
* Make specifying key handlers for built-ins simpler
* Current un-entered line is saved and recalled when cycling through history
* Support syntax coloring of member names

Expand Down
2 changes: 1 addition & 1 deletion PSReadLine/Cmdlets.cs
Original file line number Diff line number Diff line change
Expand Up @@ -853,7 +853,7 @@ public class SetPSReadLineKeyHandlerCommand : ChangePSReadLineKeyHandlerCommandB
public string BriefDescription { get; set; }

[Parameter(ParameterSetName = "ScriptBlock")]
[Alias("LongDescription")] // Alias to stay comptible with previous releases
[Alias("LongDescription")] // Alias to stay compatible with previous releases
public string Description { get; set; }

private const string FunctionParameter = "Function";
Expand Down
2 changes: 1 addition & 1 deletion PSReadLine/Completion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1079,7 +1079,7 @@ private void MenuCompleteImpl(Menu menu, CommandCompletion completions)
processingKeys = false;
prependNextKey = true;

// without this branch experience doesnt look naturally
// without this branch experience doesn't look naturally
if (_dispatchTable.TryGetValue(nextKey, out var handler) &&
(
handler.Action == CopyOrCancelLine ||
Expand Down
2 changes: 1 addition & 1 deletion PSReadLine/DisplayBlockBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ protected void MoveCursorToStartDrawingPosition(IConsole console)
{
// Calculate the coord to place the cursor at the end of current input.
Point bufferEndPoint = Singleton.ConvertOffsetToPoint(Singleton._buffer.Length);
// Top must be initialized before any possible adjustion by 'AdjustForPossibleScroll' or 'AdjustForActualScroll',
// Top must be initialized before any possible adjustment by 'AdjustForPossibleScroll' or 'AdjustForActualScroll',
// otherwise its value would be corrupted and cause rendering issue.
Top = bufferEndPoint.Y + 1;

Expand Down
4 changes: 2 additions & 2 deletions PSReadLine/Keys.cs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ internal static void TryGetCharFromConsoleKey(ConsoleKeyInfo key, ref char resul
// get corresponding scan code
uint scanCode = MapVirtualKey(virtualKey, 0x0 /*MAPVK_VK_TO_VSC*/);

// get corresponding character - maybe be 0, 1 or 2 in length (diacriticals)
// get corresponding character - may be 0, 1 or 2 in length (diacriticals)
var chars = toUnicodeBuffer.Value;
var flags = 0u; /* If bit 0 is set, a menu is active. */
var osVersion = Environment.OSVersion.Version;
Expand Down Expand Up @@ -238,7 +238,7 @@ void AppendPart(string str)
{
// A heuristic to check for dead keys --
// We got an 'OemXXX' ConsoleKey, '\0' key char, and no 'Ctrl' modifier. It's very likely generated by a dead key.
// We check for 'Ctrl' modifier because it's easy to generate '\0' KeyChar and 'OemXXX' by combinding 'Ctrl' with
// We check for 'Ctrl' modifier because it's easy to generate '\0' KeyChar and 'OemXXX' by combining 'Ctrl' with
// another special key, such as 'Ctrl+?' and 'Ctrl+;'.
isDeadKey = (c == '\0') && (consoleKey >= ConsoleKey.Oem1 && consoleKey <= ConsoleKey.Oem102) && !isCtrl;

Expand Down
30 changes: 15 additions & 15 deletions PSReadLine/Movement.cs
Original file line number Diff line number Diff line change
Expand Up @@ -527,16 +527,16 @@ private static char TryGetArgAsChar(object arg)
}

/// <summary>
/// Read a character and search forward for the next occurence of that character.
/// Read a character and search forward for the next occurrence of that character.
/// If an argument is specified, search forward (or backward if negative) for the
/// nth occurence.
/// nth occurrence.
/// </summary>
public static void CharacterSearch(ConsoleKeyInfo? key = null, object arg = null)
{
int occurence = arg as int? ?? 1;
if (occurence < 0)
int occurrence = arg as int? ?? 1;
if (occurrence < 0)
{
CharacterSearchBackward(key, -occurence);
CharacterSearchBackward(key, -occurrence);
return;
}

Expand All @@ -550,31 +550,31 @@ public static void CharacterSearch(ConsoleKeyInfo? key = null, object arg = null
{
if (_singleton._buffer[i] == toFind)
{
occurence -= 1;
if (occurence == 0)
occurrence -= 1;
if (occurrence == 0)
{
_singleton.MoveCursor(i);
break;
}
}
}
if (occurence > 0)
if (occurrence > 0)
{
Ding();
}
}

/// <summary>
/// Read a character and search backward for the next occurence of that character.
/// Read a character and search backward for the next occurrence of that character.
/// If an argument is specified, search backward (or forward if negative) for the
/// nth occurence.
/// nth occurrence.
/// </summary>
public static void CharacterSearchBackward(ConsoleKeyInfo? key = null, object arg = null)
{
int occurence = arg as int? ?? 1;
if (occurence < 0)
int occurrence = arg as int? ?? 1;
if (occurrence < 0)
{
CharacterSearch(key, -occurence);
CharacterSearch(key, -occurrence);
return;
}

Expand All @@ -588,8 +588,8 @@ public static void CharacterSearchBackward(ConsoleKeyInfo? key = null, object ar
{
if (_singleton._buffer[i] == toFind)
{
occurence -= 1;
if (occurence == 0)
occurrence -= 1;
if (occurrence == 0)
{
_singleton.MoveCursor(i);
return;
Expand Down
4 changes: 2 additions & 2 deletions PSReadLine/PSReadLineResources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions PSReadLine/PSReadLineResources.resx
Original file line number Diff line number Diff line change
Expand Up @@ -292,10 +292,10 @@
<value>Move the text from the cursor to the start of the current or previous whitespace delimited word to the kill ring</value>
</data>
<data name="CharacterSearchBackwardDescription" xml:space="preserve">
<value>Read a character and move the cursor to the previous occurence of that character</value>
<value>Read a character and move the cursor to the previous occurrence of that character</value>
</data>
<data name="CharacterSearchDescription" xml:space="preserve">
<value>Read a character and move the cursor to the next occurence of that character</value>
<value>Read a character and move the cursor to the next occurrence of that character</value>
</data>
<data name="DigitArgumentDescription" xml:space="preserve">
<value>Start or accumulate a numeric argument to other functions</value>
Expand Down
2 changes: 1 addition & 1 deletion PSReadLine/Prediction.Views.cs
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@ internal override void RenderSuggestion(List<StringBuilder> consoleBufferLines,
// The whole suggestion text cannot fit in the console buffer without having part of it scrolled up off the buffer.
// We truncate the end part and append ellipsis.

// We need to truncate 4 buffer cells ealier (just to be safe), so we have enough room to add the ellipsis.
// We need to truncate 4 buffer cells earlier (just to be safe), so we have enough room to add the ellipsis.
int lenFromEnd = SubstringLengthByCellsFromEnd(_suggestionText, length - 1, countOfCells: 4);
totalLength = length - lenFromEnd;
if (totalLength <= inputLength)
Expand Down
2 changes: 1 addition & 1 deletion PSReadLine/ReadLine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,7 @@ private void Initialize(Runspace runspace, EngineIntrinsics engineIntrinsics)
private void DelayedOneTimeInitialize()
{
// Delayed initialization is needed so that options can be set
// after the constuctor but have an affect before the user starts
// after the constructor but have an affect before the user starts
// editing their first command line. For example, if the user
// specifies a custom history save file, we don't want to try reading
// from the default one.
Expand Down
2 changes: 1 addition & 1 deletion PSReadLine/Render.Helper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ internal static int LengthInBufferCells(char c)
(c >= 0xff00 && c <= 0xff60) || /* Fullwidth Forms */
(c >= 0xffe0 && c <= 0xffe6));
// We can ignore these ranges because .Net strings use surrogate pairs
// for this range and we do not handle surrogage pairs.
// for this range and we do not handle surrogate pairs.
// (c >= 0x20000 && c <= 0x2fffd) ||
// (c >= 0x30000 && c <= 0x3fffd)
return 1 + (isWide ? 1 : 0);
Expand Down
2 changes: 1 addition & 1 deletion PSReadLine/Render.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1162,7 +1162,7 @@ private void MoveCursor(int newCursor)
_previousRender.initialY = _initialY;
}

// While waiting to render, and a keybinding has occured that is moving the cursor,
// While waiting to render, and a keybinding has occurred that is moving the cursor,
// converting offset to point could potentially result in an invalid screen position,
// but the insertion point should reflect the move.
_current = newCursor;
Expand Down
2 changes: 1 addition & 1 deletion PSReadLine/YankPaste.vi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ private void SaveLinesToClipboard(int lineIndex, int lineCount)
/// <param name="arg"></param>
/// <param name="moveCursorToEndWhenUndoDelete">
/// Use 'false' as the default value because this method is used a lot by VI operations,
/// and for VI opeartions, we do NOT want to move the cursor to the end when undoing a
/// and for VI operations, we do NOT want to move the cursor to the end when undoing a
/// deletion.
/// </param>
private void RemoveTextToViRegister(
Expand Down
2 changes: 1 addition & 1 deletion build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ if ($Clean) {
Import-Module "$PSScriptRoot/tools/helper.psm1"

if ($Bootstrap) {
Write-Log "Validate and install missing prerequisits for building ..."
Write-Log "Validate and install missing prerequisites for building ..."

Install-Dotnet
if (-not (Get-Module -Name InvokeBuild -ListAvailable)) {
Expand Down
6 changes: 3 additions & 3 deletions test/CompletionTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -975,7 +975,7 @@ public void MenuCompletions_WorkWithListView()
using var disp = SetPrediction(PredictionSource.History, PredictionViewStyle.ListView);

_console.Clear();
SetHistory("Get-Mocha -AddMilk -AddSugur -ExtraCup", "Get-MoreBook -Kind Fiction -FlatCover");
SetHistory("Get-Mocha -AddMilk -AddSugar -ExtraCup", "Get-MoreBook -Kind Fiction -FlatCover");

Test("Get-Module", Keys(
"Get-Mo",
Expand All @@ -994,8 +994,8 @@ public void MenuCompletions_WorkWithListView()
TokenClassification.ListPrediction, '>',
TokenClassification.None, ' ',
emphasisColors, "Get-Mo",
TokenClassification.None, "cha -AddMilk -AddSugur -ExtraCup",
TokenClassification.None, new string(' ', listWidth - 49), // 49 is the length of '> Get-Mocha -AddMilk -AddSugur -ExtraCup' plus '[History]'.
TokenClassification.None, "cha -AddMilk -AddSugar -ExtraCup",
TokenClassification.None, new string(' ', listWidth - 49), // 49 is the length of '> Get-Mocha -AddMilk -AddSugar -ExtraCup' plus '[History]'.
TokenClassification.None, '[',
TokenClassification.ListPrediction, "History",
TokenClassification.None, ']')),
Expand Down
2 changes: 1 addition & 1 deletion test/MockConsole.cs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ protected TestConsole(int width, int height, bool mimicScrolling)
_bufferWidth = _windowWidth = width;
_bufferHeight = _windowHeight = height;

// Use a big enough buffer when we are mimicing scrolling.
// Use a big enough buffer when we are mimicking scrolling.
int bufferSize = mimicScrolling ? BufferWidth * 1000 : BufferWidth * BufferHeight;
buffer = new CHAR_INFO[bufferSize];
ClearBuffer();
Expand Down
2 changes: 1 addition & 1 deletion test/RenderTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ public void InvokePrompt()
Tuple.Create(_console.ForegroundColor, _console.BackgroundColor), "PSREADLINE> ",
TokenClassification.Command, "dir"))));

// Tricky prompt - writes to console directly with colors, uses ^H trick to eliminate trailng space.
// Tricky prompt - writes to console directly with colors, uses ^H trick to eliminate trailing space.
using (var ps = PowerShell.Create(RunspaceMode.CurrentRunspace))
{
ps.AddCommand("New-Variable").AddParameter("Name", "__console").AddParameter("Value", _console).Invoke();
Expand Down
2 changes: 1 addition & 1 deletion tools/CheckHelp.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Import-Module $PSScriptRoot/helper.psm1
$t ='Microsoft.PowerShell.PSConsoleReadLine' -as [type]
if ($null -ne $t)
{
# Make sure we're runnning in a non-interactive session by relaunching
# Make sure we're running in a non-interactive session by relaunching
$psExePath = Get-PSExePath
& $psExePath -NoProfile -NonInteractive -File $PSCommandPath $Configuration
exit $LASTEXITCODE
Expand Down
2 changes: 1 addition & 1 deletion tools/releaseTools.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ function Get-ChangeLog
## but not reachable from the last release tag. Instead, we need to exclude the commits that were cherry-picked,
## and only include the commits that are not in the last release into the change log.

# Find the commits that were only in the orginal master, excluding those that were cherry-picked to release branch.
# Find the commits that were only in the original master, excluding those that were cherry-picked to release branch.
$new_commits_from_other_parent = git --no-pager log --first-parent --cherry-pick --right-only "$tag_hash...$other_parent_hash" --format=$format | New-CommitNode
# Find the commits that were only in the release branch, excluding those that were cherry-picked from master branch.
$new_commits_from_last_release = git --no-pager log --first-parent --cherry-pick --left-only "$tag_hash...$other_parent_hash" --format=$format | New-CommitNode
Expand Down