Set-PSReadlineKeyHandler -Chord 'Ctrl+w' -Function BackwardDeleteWord
Type some text, press Ctrl+W, if cursor on the end of line, exception raised
Exception:
System.IndexOutOfRangeException: Индекс находился вне границ массива.
в System.Text.StringBuilder.get_Chars(Int32 index)
в Microsoft.PowerShell.PSConsoleReadLine.ViFindPreviousWordPoint(Int32 i, String wordDelimiters)
в Microsoft.PowerShell.PSConsoleReadLine.BackwardDeleteWord(Nullable`1 key, Object arg)
в Microsoft.PowerShell.PSConsoleReadLine.ProcessOneKey(ConsoleKeyInfo key, Dictionary`2 dispatchTable, Boolean ignore
IfNoAction, Object arg)
в Microsoft.PowerShell.PSConsoleReadLine.InputLoop()
в Microsoft.PowerShell.PSConsoleReadLine.ReadLine(Runspace runspace, EngineIntrinsics engineIntrinsics)
Environment data
PS version: 5.1.14409.1005 PSReadline version: 1.2 os: 6.3.9600.16384 (winblue_rtm.130821-1623) PS file version: 10.0.14409.1005 (rs1_srvoob.161208-1155)
Steps to reproduce or exception report
Set-PSReadlineKeyHandler -Chord 'Ctrl+w' -Function BackwardDeleteWord
Type some text, press Ctrl+W, if cursor on the end of line, exception raisedOn any other position works as expected