Skip to content

Conversation

theaquamarine
Copy link
Contributor

Similar to SmartInsertQuote's existing ability.

Similar to SmartInsertQuote's existing ability.
} else {
# No text is selected, insert a pair
[Microsoft.PowerShell.PSConsoleReadLine]::Insert("$($key.KeyChar)$closeChar")
[Microsoft.PowerShell.PSConsoleReadLine]::SetCursorPosition($cursor + 1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be $cursor - 1 as before the change. The expectation is that the subsequent input will happen within the braces.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ignore this comment. GetBufferState is called before Insert now, so $cursor + 1 is correct.

@daxian-dbw daxian-dbw merged commit 4e75a91 into PowerShell:master Jan 13, 2020
@theaquamarine theaquamarine deleted the InsertPairedBraces branch January 14, 2020 21:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants