Skip to content

Allow InsertPairedBraces to wrap selected text #1293

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 13, 2020

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