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 identify nested keys #2

Closed
airblade opened this issue Jan 10, 2017 · 1 comment
Closed

Doesn't identify nested keys #2

airblade opened this issue Jan 10, 2017 · 1 comment

Comments

@airblade
Copy link
Owner

A line like this:

some_method "#{I18n.t('my.key')}"

– will not identify my.key as the key, but #{I18n.t('my.key')}.

Possible solutions:

  • When a match is found inside s:match(re, func, match_at_cursor), instead of returning the match immediately, keep looking for a better (i.e. shorter) match starting after the original match's start and finishing before the original match's finish.
  • Update the symbol and string patterns in s:key() to require something like I18n.t(ranslate)? at the start of the match. This would have to handle t, translate, I18n.t, I18n.translate and possibly others.
@airblade
Copy link
Owner Author

Closed by 21857c5.

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

1 participant