[Vi-Mode] Supports di' and di" commands (quoted text objects)#3791
[Vi-Mode] Supports di' and di" commands (quoted text objects)#3791springcomp wants to merge 2 commits intoPowerShell:masterfrom
Conversation
a93af44 to
2495382
Compare
daxian-dbw
left a comment
There was a problem hiding this comment.
Before moving forward with more 3-key chord supports, we need to first figure out how to make Get/Set-PSReadLineKeyHandler support chords with more than 2 keys. Today, _chordDispatchTable is a 2-level dictionary, and hence it only really supports 2-key chords. Get/Set-PSReadLineKeyHandler are implemented under that assumption.
By looking at #2059 again, I think I merged it a little too prematurely :)
Today, we have two 3-key chords built-in:
<d,g,g>-- implemented by havinggmapped toViDBChordin theDTablewith aDGTablethat maps the secondgto the handler.<d,w,i>--implemented by #2059.
There are 2 concerns here:
- Their implementation should be consistent in the way how the 3rd level dictionary is stored.
- Changes to VI key binding data structure are needed to make
Get/Set-PSReadLineKeyHandlerto support chords with 3 keys (are we stopping at 3-key chords for VI mode here? maybe we should and not support chords with more than 3 keys).
I think we should first resolve the above concerns before adding more text object commands.
| /// starting from the specified "current" position. | ||
| /// </summary> | ||
| /// <param name="current">The position in the current logical line.</param> | ||
| internal static int GetBeginningOfLogicalLinePos(this StringBuilder buffer, int current) |
There was a problem hiding this comment.
It seems GetBeginningOfLogicalLinePos and GetEndOfLogicalLinePos shoudl be put in StringBuilderLinewiseExtensions instead.
| @@ -1,4 +1,5 @@ | |||
| using System; | |||
| using System.Management.Automation; | |||
There was a problem hiding this comment.
Added by mistake? It doesn't seem to be needed by the code changes in this file.
|
BTW, the Two problems here:
It's the same for |
|
@daxian-dbw I have published #3853 to address your feedback, re-working #2059 in the process. |
PR Summary
Fixes #3790.
PR Checklist
As #2059 has been readily accepted, we have not had the time to discuss the documentation.
This PR, like #2059, wire keybindings to private methods. Please, let me know how to best document this behaviour.
Microsoft Reviewers: Open in CodeFlow