Skip to content

Vi mode function ViReplaceLine should be public #581

@gwojan

Description

@gwojan

I was attempting to map a Vi mode key to ViReplaceLine and received an error.

Environment data

PS version: 5.1.15063.674
PSReadline version: 2.0
os: 10.0.15063.0 (WinBuild.160101.0800)
PS file version: 10.0.15063.0 (WinBuild.160101.0800)

Steps to reproduce or exception report

Set-PSReadlineKeyHandler -Chord 'Ctrl+Shift+[' -Function ViReplaceLine

results in:

Set-PSReadlineKeyHandler : Cannot validate argument on parameter 'Function'. The argument "ViReplaceLine" does not belong to the set "Abort,AcceptAndGetNext,AcceptLine,AddL
ine,BackwardChar,BackwardDeleteChar,BackwardDeleteLine,BackwardDeleteWord,BackwardKillLine,BackwardKillWord,BackwardWord,BeginningOfHistory,BeginningOfLine,CancelLine,Captu
reScreen,CharacterSearch,CharacterSearchBackward,ClearHistory,ClearScreen,Complete,Copy,CopyOrCancelLine,Cut,DeleteChar,DeleteCharOrExit,DeleteEndOfWord,DeleteLine,DeleteLi
neToFirstChar,DeleteToEnd,DeleteWord,DigitArgument,EndOfHistory,EndOfLine,ExchangePointAndMark,ForwardChar,ForwardDeleteLine,ForwardSearchHistory,ForwardWord,GotoBrace,Goto
Column,GotoFirstNonBlankOfLine,HistorySearchBackward,HistorySearchForward,InsertLineAbove,InsertLineBelow,InvertCase,InvokePrompt,KillLine,KillRegion,KillWord,MenuComplete,
MoveToEndOfLine,NextHistory,NextLine,NextWord,NextWordEnd,Paste,PasteAfter,PasteBefore,PossibleCompletions,PrependAndAccept,PreviousHistory,PreviousLine,Redo,RepeatLastChar
Search,RepeatLastCharSearchBackwards,RepeatLastCommand,RepeatSearch,RepeatSearchBackward,ReverseSearchHistory,RevertLine,ScrollDisplayDown,ScrollDisplayDownLine,ScrollDispl
ayToCursor,ScrollDisplayTop,ScrollDisplayUp,ScrollDisplayUpLine,SearchChar,SearchCharBackward,SearchCharBackwardWithBackoff,SearchCharWithBackoff,SearchForward,SelectAll,Se
lectBackwardChar,SelectBackwardsLine,SelectBackwardWord,SelectForwardChar,SelectForwardWord,SelectLine,SelectNextWord,SelectShellBackwardWord,SelectShellForwardWord,SelectS
hellNextWord,SelfInsert,SetMark,ShellBackwardKillWord,ShellBackwardWord,ShellForwardWord,ShellKillWord,ShellNextWord,ShowKeyBindings,SwapCharacters,TabCompleteNext,TabCompl
etePrevious,Undo,UndoAll,UnixWordRubout,ValidateAndAcceptLine,ViAcceptLine,ViAcceptLineOrExit,ViAppendLine,ViBackwardDeleteGlob,ViBackwardGlob,ViBackwardWord,ViCommandMode,
ViDeleteBrace,ViDeleteEndOfGlob,ViDeleteGlob,ViDeleteToBeforeChar,ViDeleteToBeforeCharBackward,ViDeleteToChar,ViDeleteToCharBackward,ViDigitArgumentInChord,ViEditVisually,V
iEndOfGlob,ViEndOfPreviousGlob,ViExit,ViGotoBrace,ViInsertAtBegining,ViInsertAtEnd,ViInsertLine,ViInsertMode,ViInsertWithAppend,ViInsertWithDelete,ViJoinLines,ViNextGlob,Vi
NextWord,ViPreviousHistory,ViReplaceToBeforeChar,ViReplaceToBeforeCharBackward,ViReplaceToChar,ViReplaceToCharBackward,ViSearchHistoryBackward,ViTabCompleteNext,ViTabComple
tePrevious,ViYankBeginningOfLine,ViYankEndOfGlob,ViYankEndOfWord,ViYankLeft,ViYankLine,ViYankNextGlob,ViYankNextWord,ViYankPercent,ViYankPreviousGlob,ViYankPreviousWord,ViY
ankRight,ViYankToEndOfLine,ViYankToFirstChar,WhatIsKey,Yank,YankLastArg,YankNthArg,YankPop" specified by the ValidateSet attribute. Supply an argument that is in the set
and then try the command again.
At line:1 char:71
+ ... er -Chord 'Ctrl+Shift+['              -Function ViReplaceLine -ViMode ...
+                                                     ~~~~~~~~~~~~~
    + CategoryInfo          : InvalidData: (:) [Set-PSReadlineKeyHandler], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.SetPSReadlineKeyHandlerCommand

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions