Skip to content

v[0:10] is wrongly highlighted as goOctalError #2595

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

Closed
MoZhonghua opened this issue Nov 18, 2019 · 0 comments · Fixed by #2597
Closed

v[0:10] is wrongly highlighted as goOctalError #2595

MoZhonghua opened this issue Nov 18, 2019 · 0 comments · Fixed by #2597

Comments

@MoZhonghua
Copy link

What did you do? (required: The issue will be closed when not provided)

vim-go wrongly highlight v[0:10] as goOctalError, mininal example:

func f() {
  v := make([]int, 0)
  _ = v[0:10]
}

What did you expect to happen?

No highlight for "0:10"

What happened instead?

vim-go wrongly highlight v[0:10] as goOctalError, like this:
image

vim-go version:

master@de681fd117

k33nice added a commit to k33nice/vim-go that referenced this issue Nov 18, 2019
Fixes fatih#2595

**Changes**
- Removed ":" from goOctalError matching subgroup. It must not apply on
correct slice slicing e.g. slice[0:1].
- Created test for slice slicing highlight.
- Renamed TestZeroAsIndexElement => Test_zero_as_index_element.
- Renamed TestZeroAsSliceIndex => Test_zero_as_slice_index.
- Fix cursor position in tests Test_zero_as_slice_index and
Test_zero_as_index_element.
k33nice added a commit to k33nice/vim-go that referenced this issue Nov 18, 2019
Fixes fatih#2595

**Changes**
- Removed ":" from goOctalError matching subgroup. It must not apply on
correct slice slicing e.g. slice[0:1].
- Created test for slice slicing highlight.
- Renamed TestZeroAsIndexElement => Test_zero_as_index_element.
- Renamed TestZeroAsSliceIndex => Test_zero_as_slice_index.
- Fix cursor position in tests Test_zero_as_slice_index and
Test_zero_as_index_element.
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 a pull request may close this issue.

1 participant