Skip to content

Commit acf98b0

Browse files
committed
Initial undo/redo support
1 parent f5bcda9 commit acf98b0

File tree

4 files changed

+282
-19
lines changed

4 files changed

+282
-19
lines changed

PSReadLine/Keys.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,9 +107,10 @@ public class Keys
107107
new
108108
public static ConsoleKeyInfo Equals = new ConsoleKeyInfo('=', ConsoleKey.OemPlus, false, false, false);
109109

110-
public static ConsoleKeyInfo CtrlAt = new ConsoleKeyInfo((char)0, ConsoleKey.D2, true, false, true);
111-
public static ConsoleKeyInfo AltEquals = new ConsoleKeyInfo('=', ConsoleKey.OemPlus, false, true, false);
112-
public static ConsoleKeyInfo Space = new ConsoleKeyInfo(' ', ConsoleKey.Spacebar, false, false, false);
110+
public static ConsoleKeyInfo CtrlAt = new ConsoleKeyInfo((char)0, ConsoleKey.D2, true, false, true);
111+
public static ConsoleKeyInfo CtrlUnderbar = new ConsoleKeyInfo((char)31, ConsoleKey.OemMinus, true, false, true);
112+
public static ConsoleKeyInfo AltEquals = new ConsoleKeyInfo('=', ConsoleKey.OemPlus, false, true, false);
113+
public static ConsoleKeyInfo Space = new ConsoleKeyInfo(' ', ConsoleKey.Spacebar, false, false, false);
113114
// Useless because it's caught by the console to bring up the system menu.
114115
public static ConsoleKeyInfo AltSpace = new ConsoleKeyInfo(' ', ConsoleKey.Spacebar, false, true, false);
115116
public static ConsoleKeyInfo CtrlSpace = new ConsoleKeyInfo(' ', ConsoleKey.Spacebar, false, false, true);

PSReadLine/PSReadLineResources.Designer.cs

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

PSReadLine/PSReadLineResources.resx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,8 +213,11 @@
213213
<data name="PreviousHistoryDescription" xml:space="preserve">
214214
<value>Replace the input with the previous item in the history</value>
215215
</data>
216+
<data name="RedoDescription" xml:space="preserve">
217+
<value>Redo an undo</value>
218+
</data>
216219
<data name="RevertLineDescription" xml:space="preserve">
217-
<value>Clear the current input</value>
220+
<value>Equivalent to undo all edits (clears the line except lines imported from history)</value>
218221
</data>
219222
<data name="SetMarkDescription" xml:space="preserve">
220223
<value>Mark the location of the cursor</value>
@@ -225,6 +228,9 @@
225228
<data name="TabCompletePreviousDescription" xml:space="preserve">
226229
<value>Complete the input using the previous completion</value>
227230
</data>
231+
<data name="UndoDescription" xml:space="preserve">
232+
<value>Undo a previous edit</value>
233+
</data>
228234
<data name="YankDescription" xml:space="preserve">
229235
<value>Copy the text from the current kill ring position to the input</value>
230236
</data>

0 commit comments

Comments
 (0)