76 Commits
Author SHA1 Message Date
Maxime Labelle 1966609701 [vi-mode] Undo now leaves the cursor under the position at the start of the deletion (#2045) 2021-09-21 23:04:43 -07:00
Maxime Labelle 9d5b41f1f6 Refactor the usage of _clipboard (#2022) 2021-02-09 22:14:12 -08:00
Maxime Labelle 1f6c5c0bc0 Deleting backward to or until a character should preserve the character under the cursor (#2007) 2020-12-07 11:43:30 -08:00
Maxime Labelle 352edb9c62 Use 'd^' to delete from the first non-blank character of a logical line (#2001) 2020-12-07 11:37:10 -08:00
Dongbo Wang fd1265e385 Add the prediction ListView and also hook up with the CommandPrediction APIs introduced in PS 7.1 (#1909) 2020-11-03 14:17:37 -08:00
Maxime Labelle a45ab815a8 vi-mode: Add dgg to delete from the beginning of the buffer to the current logical line (#1752) 2020-09-10 11:45:27 -07:00
Maxime Labelle 70249682ed vi-mode: Use dk to delete the previous n logical lines and the current logical line in a multi-line buffer (#1737) 2020-08-12 12:00:22 -07:00
Maxime Labelle 1d3964160d vi-mode - Make 'dj' delete the current and next n logical lines (#1697) 2020-07-29 16:51:15 -07:00
Maxime Labelle 8b0cc85965 vi-mode: Make 'D' and 'd$' delete to the end of the current logical line (#1695) 2020-07-26 10:26:08 -07:00
Maxime Labelle 8d74e42664 vi-mode: 'dd' now handles single line or multiline buffers consistently (#1694) 2020-07-26 10:25:14 -07:00
Maxime Labelle c7ef3bd0f6 vi-mode: Add 'dG' to delete to the end of multiline buffer (#1692) 2020-07-25 11:06:54 -07:00
Maxime Labelle cd3ca2911d vi-mode: Make 'dd' deletes the logical line instead of the entire buffer (#1658) 2020-07-24 23:08:05 -07:00
Dongbo Wang 9e6c6b9481 Add basic support for inline predictive suggestion (#1496) 2020-05-09 15:44:04 -07:00
Dongbo Wang 958ce3aeb2 Fix a few VI edit mode issues (#1262) 2020-01-07 13:08:39 -08:00
Dongbo Wang fd13554df8 Preserve and clear the saved current line properly (#1259)
1. Preserve the saved current line and the history index while in a series of history commands.
    So when switching between different history command, such as from `F8`/`Shift+F8` (`HistorySearchBackward` and `HistorySearchForward`) to `UpArrow`/`DownArrow`  (recall history) or from `Ctrl+r`/`Ctrl+s` to `UpArrow`/`DownArrow`, the history command can continue to work as expected.
2. Clear the saved current line when we are out of a series of history commands.
    So the saved line will not leak to another unrelated history search.
2020-01-01 22:44:46 -08:00
Mike Battista 7e688f0cd5 Fix RepeatLastCharSearch and RepeatLastCharSearchBackwards to not flip their functionalities (#1253) 2019-12-19 12:59:57 -08:00
Maxime Labelle f25a089290 Supporting line wise yanks, including paste and undo. (#811) 2019-11-08 14:42:13 -08:00
Maxime Labelle 197a3fdc83 In VI mode, moving left or right should stick cursor on logical line (#1120) 2019-10-29 16:56:59 -07:00
Jason Shirk a7af25aa37 Stop dispatching on ConsoleKeyInfo (#831)
There are likely issues introduced by this PR,
but I'm merging for a new Beta so this code gets more testing.

* Introduce PSKeyInfo type alias
* Explicit conversions b/w ConsoleKeyInfo and PSKeyInfo
* Change tests to use actual ConsoleKeyInfo data
* Add fr-FR keyboard layout tests
* Add KeyInfo-ru-RU-windows.json (#839)

All impossible without Shift shortcuts labeled as "Investigate: true"
Alt+Spacebar tracked by windows itself

* Add KeyInfo for Polish (Programmers) layout on Windows and Linux (#870)

On Windows *Alt+Spacebar* is hijacked by Windows
On Linux any *Alt+F1-12* combination was not detected
2019-03-20 16:14:05 -07:00
Maxime Labelle 803008a092 ViAppendLine crashes with cursor at end of input on empty line (#797)
Fix #796
2018-11-09 10:57:57 -08:00
Parker Snell c6dabcf9f9 Add script block vi mode indicator option 2018-09-12 10:23:59 -07:00
srdubya 8e7900b486 Fixed CompleteMenu in vi insert mode (#656)
Fix by exiting insert mode to clear the GroupEdit and then re-entering insert mode.

Fixes #651
2018-03-25 10:14:52 -07:00
srdubya c385dd5bcb Fix 2 vi-mode cursor placement issues (#627)
Fix cursor placement after `cf`
Also fix cursor placement with `s` at EOL.

Fix #623
2018-01-28 11:53:29 -08:00
Jason Shirk ef6654790d Fix exception in SwapCharacters with short line
Fix #599
2017-12-01 22:27:04 -08:00
Jason Shirk b2c04745e0 Don't add immediate duplicates to history
Also add a public api to access PSReadLine history (helpful in testing
this change.

Fix #562 #533
2017-11-26 17:51:46 -08:00
Jason Shirk 193b4da3ac Fix cursor placement after history replacement
A fix for vi mode broke placing the cursor after recalling commands from
history.

There was also a small inconcistency in placing the cursor in vi mode
when in command mode.

Fix #592
2017-11-25 21:30:45 -08:00
Jason Shirk 9094f1246b Generate parts of the about topic
To keep the about topic up to date, the function descriptions and key
binding information is now generated after a build.
2017-11-24 22:11:13 -08:00
Jason Shirk 63d2dcf6da Portable custom key bindings
Rewrote the custom key binding code to be more portable.

Some runtime checks are necessary because of impossible to reconcile
differences.

Some Win32 P/Invoke calls are still needed due to lack of information in
the ConsoleKeyInfo.

Some keys are currently not available on Linux due to a CLR bug, others
aren't available ever because terminals don't unique character sequences
for a given key press that might differ in just the Shift or Ctrl state.
2017-10-15 22:03:56 -07:00
Jason Shirk a7efcd27ca XML comment cleanup 2017-09-03 00:06:41 -07:00
Jason Shirk 245000c3b7 Remove #region 2017-09-02 21:09:40 -07:00
Josh Soref ff80a13550 Spelling comments
* spelling: comments in src/Microsoft.PowerShell.PSReadLine
2017-09-02 21:03:11 -07:00
Jason Shirk 855ed7f78c Unify internal and visible cursor updates 2017-07-31 18:08:07 -07:00
Jason Shirk 72d1a31002 Use null propagation 2017-07-31 17:33:46 -07:00
Jason Shirk 443b9a5240 use nameof 2017-07-31 17:22:23 -07:00
Jason Shirk aed8135e5f Remove old comments from DemoMode 2017-07-31 17:12:56 -07:00
Jason Shirk d5566e7a76 Avoid redundant default arguments 2017-07-31 17:04:42 -07:00
Jason Shirk 01d1dd23f1 Remove redundant field initializers 2017-07-31 16:53:13 -07:00
Jason Shirk a02554d25d Use expression body property/method 2017-07-31 16:51:25 -07:00
Jason Shirk 4aba251bdb Remove unused using directives 2017-07-31 16:44:06 -07:00
Jason Shirk a7c0a907e1 Use null coalescing operator 2017-07-31 16:38:43 -07:00
Jason Shirk fc55704f83 Inline out variable parameters 2017-07-31 16:24:57 -07:00
andrewcromwell e1dcaaeded Character swapping fixes (#538)
* allow swapping at end of line
* add SwapCharacters to default emacs keybindings
* limit cursor location in SwapCharacters (vi mode)
* add SwapCharacters to insert mode vi bindings
2017-06-06 09:10:56 -07:00
srdubya 70200bb780 Fix a few VI mode issues
* Made several VI methods public (#445)
* Fixed IndexOutOfRangeException (#456)
* Add ReverseSearchHistory (Ctrl+R,Ctrl+S) in VI mode (#455)
2016-11-28 17:16:50 -08:00
srdubya 986bb817c7 Addressed #445 by making several VI methods public. 2016-09-26 12:11:01 -07:00
Jason Shirk (POWERSHELL) 4ddd039fcd specify culture explicitly to ToLower/ToUpper 2016-04-27 16:38:55 -07:00
Jason Shirk (POWERSHELL) 04c7233b46 Globally suppress 'default args should not be used' 2016-04-27 16:36:50 -07:00
Jason Shirk (POWERSHELL) cc6eaa711e Update xmldoc comments 2016-01-17 09:01:02 -08:00
Jason Shirk (POWERSHELL) 6f741c5421 Startup improvements
- Delay loading resources until they are used
- Delay creating vi mode key handler tables
- Remove format.ps1xml file
2016-01-17 08:58:07 -08:00
srdubya b80ffb9b09 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?
2016-01-02 08:51:06 -07:00
Dan Thompson d38c9624b0 Add the ability to change Vi cmd mode dispatch tables. 2015-12-09 22:48:35 -08:00