Skip to content
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

Fix correct way to get substring based on buffercells when encountering CJK chars #1100

Merged
merged 3 commits into from Oct 16, 2019

Conversation

SteveL-MSFT
Copy link
Member

Code was correctly calculating the number of buffer cells for CJK chars, but then used substring() to get a substring which failed as the number of cells is > number of chars. Fix is to have a SubstringByCells() method that understands how to return substring based on cells. Also using unicode ellipsis char instead of ... to save screen space.

Tried to add a unittest, but couldn't get the CJK char to work with KeyboardLayout.

Fix #847

PSReadLine/Render.cs Outdated Show resolved Hide resolved
PSReadLine/Render.cs Outdated Show resolved Hide resolved
@daxian-dbw daxian-dbw merged commit 664b168 into PowerShell:master Oct 16, 2019
@SteveL-MSFT SteveL-MSFT deleted the cjk-crash branch October 18, 2019 21:29
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.

'GetMenuItem' throw ArgumentOutOfRangeException for CKJ completion items
3 participants