-
Notifications
You must be signed in to change notification settings - Fork 12
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
PascalCase
matches one word
#27
Comments
Thanks for the report. You are right, it is inconvenient. |
Using Regex Lookahead, a sequence of capital letters can be considered a single word. const regex = /[A-Z]([A-Z](?![a-z]))+|[A-Z][a-z]*/g
'LicenseMIT'.match(regex)
// -> ['License', 'MIT']
'ParseCLanguage'.match(regex)
// -> ['Parse', 'C', 'Language']
'JSONToYAMLConverter'.match(regex)
// -> ['JSON', 'To', 'YAML', 'Converter'] In this case, however, there are some probrems.
It is a difficult problem and it may good to ignore the word that has a sequence of capital letters. I reported this issue because the behavior was different from the help. |
Yes, as you say, the current implementation is compatibility oriented. |
@monaqa A "potential" solution/workaround could be to implement something similar to |
The help says
Currently, this augend does NOT recognize identifiers that consist of only one word.
, butPascalCase
matches to the word starts with capital letter like 'Word' and 'WORD'.This is a minimum setting to reproduce ↓
In this GIF, dial.nvim thinks that 'EOF' is PascalCase ↓
The text was updated successfully, but these errors were encountered: