Skip to content

Commit ea25286

Browse files
authored
Update the sample in README.md to work in strict mode (#3440)
1 parent cb0e0d4 commit ea25286

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ Set-PSReadLineKeyHandler -Chord '"',"'" `
187187
$cursor = $null
188188
[Microsoft.PowerShell.PSConsoleReadLine]::GetBufferState([ref]$line, [ref]$cursor)
189189
190-
if ($line[$cursor] -eq $key.KeyChar) {
190+
if ($line.Length -gt $cursor -and $line[$cursor] -eq $key.KeyChar) {
191191
# Just move the cursor
192192
[Microsoft.PowerShell.PSConsoleReadLine]::SetCursorPosition($cursor + 1)
193193
}

0 commit comments

Comments
 (0)