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

Doesn't work that good with Cyrillic text #38

Closed
ForNeVeR opened this issue May 19, 2017 · 3 comments
Closed

Doesn't work that good with Cyrillic text #38

ForNeVeR opened this issue May 19, 2017 · 3 comments

Comments

@ForNeVeR
Copy link

ForNeVeR commented May 19, 2017

The Problem

Consider this sample:

First paragraph is written in Latin alphabet:

qqqqqqqqqqqqq qqqqqqqqqq qqqqqqqqqqqqq qqqqqqqqqq qqqqqqqqqqqqq qqqqqqqqqq qqqqqqqqqqqqq qqqqqqqqqq qqqqqqqqqqqqq qqqqqqqqqq

Second paragraph is written with Cyrillic `я`:

яяяяяяяяяяяяя яяяяяяяяяя яяяяяяяяяяяяя яяяяяяяяяя яяяяяяяяяяяяя яяяяяяяяяя яяяяяяяяяяяяя яяяяяяяяяя яяяяяяяяяяяяя яяяяяяяяяя

After I select both paragraphs and press Alt + Q (hotkey for "Rewrap Comment / Text" action in my VSCode), the first paragraph gets rewrapped, but the second isn't:

First paragraph is written in Latin alphabet:

qqqqqqqqqqqqq qqqqqqqqqq qqqqqqqqqqqqq qqqqqqqqqq qqqqqqqqqqqqq qqqqqqqqqq
qqqqqqqqqqqqq qqqqqqqqqq qqqqqqqqqqqqq qqqqqqqqqq

Second paragraph is written with Cyrillic `я`:

яяяяяяяяяяяяя яяяяяяяяяя яяяяяяяяяяяяя яяяяяяяяяя яяяяяяяяяяяяя яяяяяяяяяя яяяяяяяяяяяяя яяяяяяяяяя яяяяяяяяяяяяя яяяяяяяяяя

Sometimes the Cyrillic text can be rewrapped if it contains some words in Latin, but most of the time it doesn't work.

Possible Reason

Please note that the common issue with this kind of trouble is JS regex engine: its' \w doesn't work with all different scripts (Cyrillic and others). Take a look on how I've solved a similar problem in another project (the fix was very simple, but requires additional module from npm): maptz/Maptz.VSCode.Extensions.CamelCaseNavigation#8

ForNeVeR added a commit to ForNeVeR/vscode-rewrap that referenced this issue May 20, 2017
ForNeVeR added a commit to ForNeVeR/vscode-rewrap that referenced this issue May 20, 2017
ForNeVeR added a commit to ForNeVeR/vscode-rewrap that referenced this issue May 20, 2017
stkb added a commit that referenced this issue Jun 11, 2017
@stkb
Copy link
Owner

stkb commented Jun 11, 2017

Thanks for the detailed issue and fixes!
See my comment on #39, and #40 for details of the new version.

@ForNeVeR
Copy link
Author

Thank you! I've tested the 1.4.0-beta1, and the issue has been fixed. Should I close the issue now, or will you close them all after 1.4.0 release?

@stkb
Copy link
Owner

stkb commented Jun 11, 2017

Normally I wait until the version has been released before closing, but as you're happy with it I will close this one now. Thanks for testing!

@stkb stkb closed this as completed Jun 11, 2017
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

No branches or pull requests

2 participants