mirror of
https://github.com/PowerShell/PSReadLine
synced 2026-06-08 12:12:13 +00:00
Update the sample in README.md to work in strict mode (#3440)
This commit is contained in:
@@ -187,7 +187,7 @@ Set-PSReadLineKeyHandler -Chord '"',"'" `
|
||||
$cursor = $null
|
||||
[Microsoft.PowerShell.PSConsoleReadLine]::GetBufferState([ref]$line, [ref]$cursor)
|
||||
|
||||
if ($line[$cursor] -eq $key.KeyChar) {
|
||||
if ($line.Length -gt $cursor -and $line[$cursor] -eq $key.KeyChar) {
|
||||
# Just move the cursor
|
||||
[Microsoft.PowerShell.PSConsoleReadLine]::SetCursorPosition($cursor + 1)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user