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

Multibyte characters preceding offense breaks position and formatting on cached results #3099

Closed
ghost opened this issue May 1, 2016 · 2 comments

Comments

@ghost
Copy link

ghost commented May 1, 2016

When there are multibyte UTF-8 characters that precede an offense, then the position of offense and subsequent formatting and underlining is incorrect when displaying cached results.

Expected behavior

Cached results should match first-time results.

Actual behavior

Cached results do not match first-time results.

Steps to reproduce the problem

Run rubocop twice on a file containing this UTF-8 text:

puts "føø"
useless = 'bar'

Note that foo is spelled using the Unicode character U+00F8 'Latin Small Letter o With Stroke', which in UTF-8 requires two octets. The first time rubocop runs, it will correctly underline 'useless' and indicate a position of 2:1. On the second time, when it is using cached results, it underlines the end of the first line and indicates a position of 1:12.

RuboCop version

$ rubocop -V
0.39.0 (using Parser 2.3.0.7, running on ruby 2.3.0 x86_64-darwin15)
@owst
Copy link
Contributor

owst commented May 2, 2016

This appears to have been fixed - running the HEAD version as of today (624705384ce42e529c479c10f03d0e99a5ae39f8) does not reproduce the issue. I think it was quite possibly fixed by #3000.

@ghost ghost mentioned this issue May 7, 2016
9 tasks
@owst
Copy link
Contributor

owst commented Jun 7, 2016

@bbatsov I think this can be closed

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