Skip to content

Commit a2a409d

Browse files
authored
Expose 'ViBackwardChar' and 'ViForwardChar' as bindable functions (#1547)
1 parent 65d332e commit a2a409d

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

PSReadLine/KeyBindings.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,9 @@ public static KeyHandlerGroup GetDisplayGrouping(string function)
502502
case nameof(ShellBackwardWord):
503503
case nameof(ShellForwardWord):
504504
case nameof(ShellNextWord):
505+
case nameof(ViBackwardChar):
505506
case nameof(ViBackwardWord):
507+
case nameof(ViForwardChar):
506508
case nameof(ViEndOfGlob):
507509
case nameof(ViEndOfPreviousGlob):
508510
case nameof(ViGotoBrace):

PSReadLine/Movement.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ public static void BackwardChar(ConsoleKeyInfo? key = null, object arg = null)
8787
/// <summary>
8888
/// Moves the cursor one character to the right on a single logical line.
8989
/// </summary>
90-
private static void ViForwardChar(ConsoleKeyInfo? key = null, object arg = null)
90+
public static void ViForwardChar(ConsoleKeyInfo? key = null, object arg = null)
9191
{
9292
if (TryGetArgAsInt(arg, out var numericArg, 1))
9393
{
@@ -105,7 +105,7 @@ private static void ViForwardChar(ConsoleKeyInfo? key = null, object arg = null)
105105
/// <summary>
106106
/// Move the cursor one character to the left on a single logical line.
107107
/// </summary>
108-
private static void ViBackwardChar(ConsoleKeyInfo? key = null, object arg = null)
108+
public static void ViBackwardChar(ConsoleKeyInfo? key = null, object arg = null)
109109
{
110110
if (TryGetArgAsInt(arg, out var numericArg, 1))
111111
{

PSReadLine/PSReadLineResources.resx

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -591,6 +591,12 @@ If there are other parse errors, unresolved commands, or incorrect parameters, s
591591
<data name="ViBackwardWordDescription" xml:space="preserve">
592592
<value>Delete backward to the beginning of the previous word, as delimited by white space and common delimiters, and enter insert mode.</value>
593593
</data>
594+
<data name="ViBackwardCharDescription" xml:space="preserve">
595+
<value>Move the cursor back one character in the Vi edit mode.</value>
596+
</data>
597+
<data name="ViForwardCharDescription" xml:space="preserve">
598+
<value>Move the cursor forward one character in the Vi edit mode.</value>
599+
</data>
594600
<data name="PasteAfterDescription" xml:space="preserve">
595601
<value>Write the contents of the local clipboard after the cursor.</value>
596602
</data>

0 commit comments

Comments
 (0)