Skip to content

Commit b80ffb9

Browse files
committed
Addressed this feedback:
1 _normalBackground (keybindings.vi.cs) unused 2 copyright notice in *.vi.cs files? 3 ReadLine.vi.cs - InsertCharacter unreferenced 4 SearchBackward - change fn name to ViSearchHistoryBackward?
1 parent 2269484 commit b80ffb9

11 files changed

+56
-31
lines changed

PSReadLine/Completion.vi.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
using System;
1+
/********************************************************************++
2+
Copyright (c) Microsoft Corporation. All rights reserved.
3+
--********************************************************************/
4+
5+
using System;
26
using System.Collections;
37
using System.Collections.Generic;
48
using System.Diagnostics;

PSReadLine/KeyBindings.vi.cs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
using System;
1+
/********************************************************************++
2+
Copyright (c) Microsoft Corporation. All rights reserved.
3+
--********************************************************************/
4+
5+
using System;
26
using System.Collections.Generic;
37
using System.Linq;
48
using System.Text;
@@ -36,7 +40,6 @@ public static ConsoleColor AlternateBackground(ConsoleColor bg)
3640
}
3741

3842
private int _normalCursorSize = 10;
39-
private ConsoleColor _normalBackground = ConsoleColor.Black;
4043

4144
private static KeyHandler MakeViKeyHandler(Action<ConsoleKeyInfo?, object> action, string briefDescription, string longDescription = null)
4245
{
@@ -196,7 +199,7 @@ private static KeyHandler MakeViKeyHandler(Action<ConsoleKeyInfo?, object> actio
196199
{ Keys.Pipe, MakeViKeyHandler(GotoColumn, "GotoColumn") },
197200
{ Keys.Uphat, MakeViKeyHandler(GotoFirstNonBlankOfLine, "GotoFirstNonBlankOfLine") },
198201
{ Keys.Tilde, MakeViKeyHandler(InvertCase, "InvertCase") },
199-
{ Keys.Slash, MakeViKeyHandler(SearchBackward, "SearchBackward") },
202+
{ Keys.Slash, MakeViKeyHandler(ViSearchHistoryBackward, "SearchBackward") },
200203
{ Keys.CtrlR, MakeViKeyHandler(SearchCharBackward, "SearchCharBackward") },
201204
{ Keys.Question, MakeViKeyHandler(SearchForward, "SearchForward") },
202205
{ Keys.CtrlS, MakeViKeyHandler(SearchForward, "SearchForward") },
@@ -286,7 +289,6 @@ private void SetDefaultViBindings()
286289
_viCmdChordTable[Keys.Y] = _viChordYTable;
287290

288291
_normalCursorSize = _console.CursorSize;
289-
_normalBackground = _console.BackgroundColor;
290292
}
291293
}
292294
}

PSReadLine/Movement.vi.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
using System;
1+
/********************************************************************++
2+
Copyright (c) Microsoft Corporation. All rights reserved.
3+
--********************************************************************/
4+
5+
using System;
26
using System.Collections.Generic;
37
using System.Linq;
48
using System.Text;

PSReadLine/PSReadLineResources.Designer.cs

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

PSReadLine/PSReadLineResources.resx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -546,7 +546,7 @@ If there are other parse errors, unresolved commands, or incorrect parameters, s
546546
<data name="InsertCharacterDescription" xml:space="preserve">
547547
<value>Delete the current character and insert the next character.</value>
548548
</data>
549-
<data name="SearchBackwardDescription" xml:space="preserve">
549+
<data name="ViSearchHistoryBackwardDescription" xml:space="preserve">
550550
<value>Starts a new seach backward in the history.</value>
551551
</data>
552552
<data name="ViTransposeCharsDescription" xml:space="preserve">

PSReadLine/ReadLine.vi.cs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
using System;
1+
/********************************************************************++
2+
Copyright (c) Microsoft Corporation. All rights reserved.
3+
--********************************************************************/
4+
5+
using System;
26
using System.Collections.Generic;
37
using System.Diagnostics;
48
using System.Diagnostics.CodeAnalysis;
@@ -233,15 +237,6 @@ public static void ViExit(ConsoleKeyInfo? key = null, object arg = null)
233237
throw new ExitException();
234238
}
235239

236-
/// <summary>
237-
/// Insert the next key entered.
238-
/// </summary>
239-
private static void InsertCharacter(object arg = null)
240-
{
241-
ConsoleKeyInfo secondKey = ReadKey();
242-
_singleton.ProcessOneKey(secondKey, _viInsKeyMap, ignoreIfNoAction: false, arg: arg);
243-
}
244-
245240
/// <summary>
246241
/// Delete to the end of the line.
247242
/// </summary>
@@ -840,7 +835,7 @@ private static void DeleteRange(int first, int last, Action<ConsoleKeyInfo?, obj
840835
/// <summary>
841836
/// Prompts for a search string and initiates search upon AcceptLine.
842837
/// </summary>
843-
public static void SearchBackward(ConsoleKeyInfo? key = null, object arg = null)
838+
public static void ViSearchHistoryBackward(ConsoleKeyInfo? key = null, object arg = null)
844839
{
845840
if (!key.HasValue || char.IsControl(key.Value.KeyChar))
846841
{

PSReadLine/Replace.vi.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
using System;
1+
/********************************************************************++
2+
Copyright (c) Microsoft Corporation. All rights reserved.
3+
--********************************************************************/
4+
5+
using System;
26
using System.Collections.Generic;
37
using System.Diagnostics;
48
using System.Diagnostics.CodeAnalysis;

PSReadLine/UndoRedo.vi.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
using System;
1+
/********************************************************************++
2+
Copyright (c) Microsoft Corporation. All rights reserved.
3+
--********************************************************************/
4+
5+
using System;
26
using System.Collections.Generic;
37
using System.Diagnostics;
48
using System.Linq;

PSReadLine/VisualEditing.vi.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
using System;
1+
/********************************************************************++
2+
Copyright (c) Microsoft Corporation. All rights reserved.
3+
--********************************************************************/
4+
5+
using System;
26
using System.Collections.Generic;
37
using System.IO;
48
using System.Linq;

PSReadLine/Words.vi.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
/********************************************************************++
2+
Copyright (c) Microsoft Corporation. All rights reserved.
3+
--********************************************************************/
4+
15
using System.Collections.Generic;
26
using System.Management.Automation.Language;
37

0 commit comments

Comments
 (0)