Invalid highlight of preprocessor block comments (C language) #57

Closed
fcelda opened this Issue Jun 17, 2013 · 15 comments

Comments

Projects
None yet
3 participants
@fcelda

fcelda commented Jun 17, 2013

Types and function names in blocks of C code commented out using preprocessor macros (#if 0+#endif) are incorrectly highlighted. They should be highlighted as a comment.

See the screenshot:

wrong-highlight

xolox added a commit that referenced this issue Jun 17, 2013

Bug fix: Don't highlight C tags inside #if 0 (issue #57)
$VIMRUNTIME/syntax/c.vim is a bit of a mess, I can't make heads or tails
of it :-). In my simple #if 0 / #if 1 / #else tests this fixes the issue,
but I'm not sure that there are no corner cases left.

See issue #57 on GitHub:
  #57
@xolox

This comment has been minimized.

Show comment Hide comment
@xolox

xolox Jun 17, 2013

Owner

Thanks for the bug report. I believe I just fixed this in the latest release. Can you confirm? If it now works for you, please close the issue on GitHub. Happy Vimming!

Owner

xolox commented Jun 17, 2013

Thanks for the bug report. I believe I just fixed this in the latest release. Can you confirm? If it now works for you, please close the issue on GitHub. Happy Vimming!

@fcelda

This comment has been minimized.

Show comment Hide comment
@fcelda

fcelda Jun 17, 2013

Thank you for quick response. Unfortunately it is not fixed.

I have verified that g:easytags_ignored_syntax_groups is really set to '.*String.*,.*Comment.*,cIncluded,cCppInElse2,cCppOutIf2', but I'm still seeing the function names and structures highlighted. Do you need some additional information?

fcelda commented Jun 17, 2013

Thank you for quick response. Unfortunately it is not fixed.

I have verified that g:easytags_ignored_syntax_groups is really set to '.*String.*,.*Comment.*,cIncluded,cCppInElse2,cCppOutIf2', but I'm still seeing the function names and structures highlighted. Do you need some additional information?

@fcelda

This comment has been minimized.

Show comment Hide comment
@fcelda

fcelda Jun 17, 2013

Adding cCppOut2 seems to fix it for me... but I'm not sure if it is a correct fix.

fcelda commented Jun 17, 2013

Adding cCppOut2 seems to fix it for me... but I'm not sure if it is a correct fix.

@fcelda

This comment has been minimized.

Show comment Hide comment
@fcelda

fcelda Jun 18, 2013

It seems that the invalid highlight happens even in Doxygen comments.

fcelda commented Jun 18, 2013

It seems that the invalid highlight happens even in Doxygen comments.

xolox added a commit that referenced this issue Jun 19, 2013

@xolox

This comment has been minimized.

Show comment Hide comment
@xolox

xolox Jun 19, 2013

Owner

Thanks for the feedback! I just released version 3.3.8 to GitHub and Vim.org. It should fix both of the issues you reported (cCppOut2 and Doxygen comments) since my last release. If I still missed some highlighting groups, feel free to get back to me again. It's little trouble to add this and of course the better the experience for new users of vim-easytags is, the happier I am as well :-)

Owner

xolox commented Jun 19, 2013

Thanks for the feedback! I just released version 3.3.8 to GitHub and Vim.org. It should fix both of the issues you reported (cCppOut2 and Doxygen comments) since my last release. If I still missed some highlighting groups, feel free to get back to me again. It's little trouble to add this and of course the better the experience for new users of vim-easytags is, the happier I am as well :-)

@xolox

This comment has been minimized.

Show comment Hide comment
@xolox

xolox Jun 19, 2013

Owner

Small heads up: I just noticed a very unpleasant behavior in Vim's :syntax command:

easytags.vim 3.3.8: Vim(syntax):E409: Unknown group name: doxygen.* (at function xolox#easytags#autoload..xolox#easytags#highlight, line 49)

I have some ideas about how to work around this, will fix it this evening.

Owner

xolox commented Jun 19, 2013

Small heads up: I just noticed a very unpleasant behavior in Vim's :syntax command:

easytags.vim 3.3.8: Vim(syntax):E409: Unknown group name: doxygen.* (at function xolox#easytags#autoload..xolox#easytags#highlight, line 49)

I have some ideas about how to work around this, will fix it this evening.

@ixti

This comment has been minimized.

Show comment Hide comment
@ixti

ixti Jun 19, 2013

@xolox I have same E409 when I try to update tags

ixti commented Jun 19, 2013

@xolox I have same E409 when I try to update tags

@xolox

This comment has been minimized.

Show comment Hide comment
@xolox

xolox Jun 19, 2013

Owner

@ixti Sorry about that, it was an unintended consequence of the changes made in response to this issue. I just now released a new version of vim-easytags that should resolve both issues (the original one and the one I introduced earlier tonight).

Owner

xolox commented Jun 19, 2013

@ixti Sorry about that, it was an unintended consequence of the changes made in response to this issue. I just now released a new version of vim-easytags that should resolve both issues (the original one and the one I introduced earlier tonight).

@ixti

This comment has been minimized.

Show comment Hide comment
@ixti

ixti Jun 19, 2013

@xolox You're the man! Works like a charm! Thanks!

ixti commented Jun 19, 2013

@xolox You're the man! Works like a charm! Thanks!

@ixti

This comment has been minimized.

Show comment Hide comment
@ixti

ixti Jun 19, 2013

Hmm... some other problems came out, not sure if i need to report a new issue.

Yhis one happened after i tried :UpdateTags -R . in my rails app directory

easytags.vim 3.3.9: Vim(let):E684: list index out of range: 0 (at function xolox#easytags#update..<SNR>66_prep_cmdline, line 3)

This one came out when I tried :UpdateTags -R app/

easytags.vim 3.3.9: Failed to highlight 4952 rubyMethodName tags because pattern is too big! (86 KB)

ixti commented Jun 19, 2013

Hmm... some other problems came out, not sure if i need to report a new issue.

Yhis one happened after i tried :UpdateTags -R . in my rails app directory

easytags.vim 3.3.9: Vim(let):E684: list index out of range: 0 (at function xolox#easytags#update..<SNR>66_prep_cmdline, line 3)

This one came out when I tried :UpdateTags -R app/

easytags.vim 3.3.9: Failed to highlight 4952 rubyMethodName tags because pattern is too big! (86 KB)
@xolox

This comment has been minimized.

Show comment Hide comment
@xolox

xolox Jun 19, 2013

Owner

@ixti:

Yhis one happened after i tried :UpdateTags -R . in my rails app directory

easytags.vim 3.3.9: Vim(let):E684: list index out of range: 0 (at function xolox#easytags#update..<SNR>66_prep_cmdline, line 3)

This might be a bug, I'll look into it tomorrow.

This one came out when I tried :UpdateTags -R app/

easytags.vim 3.3.9: Failed to highlight 4952 rubyMethodName tags because pattern is too big! (86 KB)

This is certainly nothing new, you just hit the limit of what Vim can highlight. I have some plans about how to improve this; it's on my to-do list. Two tips for the current situation:

  • As a short term stop gap measure, try running :UpdateTags!. That will cleanup your tags file, it might help a lot (or it might not help at all, but it's worth a shot :-).
  • I think the readme also gives some hints about performance, for example file type or project specific tags files help in this respect, because vim-easytags has less work to do
Owner

xolox commented Jun 19, 2013

@ixti:

Yhis one happened after i tried :UpdateTags -R . in my rails app directory

easytags.vim 3.3.9: Vim(let):E684: list index out of range: 0 (at function xolox#easytags#update..<SNR>66_prep_cmdline, line 3)

This might be a bug, I'll look into it tomorrow.

This one came out when I tried :UpdateTags -R app/

easytags.vim 3.3.9: Failed to highlight 4952 rubyMethodName tags because pattern is too big! (86 KB)

This is certainly nothing new, you just hit the limit of what Vim can highlight. I have some plans about how to improve this; it's on my to-do list. Two tips for the current situation:

  • As a short term stop gap measure, try running :UpdateTags!. That will cleanup your tags file, it might help a lot (or it might not help at all, but it's worth a shot :-).
  • I think the readme also gives some hints about performance, for example file type or project specific tags files help in this respect, because vim-easytags has less work to do
@ixti

This comment has been minimized.

Show comment Hide comment
@ixti

ixti Jun 20, 2013

Thanks, man!

ixti commented Jun 20, 2013

Thanks, man!

xolox added a commit that referenced this issue Jun 22, 2013

Bug fix for :UpdateTags: Gracefully handle case where no supported fi…
…le type is known

See the comment by @ixti in issue #57 on GitHub:
  #57 (comment)
@xolox

This comment has been minimized.

Show comment Hide comment
@xolox

xolox Jun 22, 2013

Owner

I'm closing this issue now because I believe the original problem reported by @fcelda is resolved. If it's not, feel free to reopen this issue. Thanks for the feedback and happy Vimming!


@ixti:

Yhis one happened after i tried :UpdateTags -R . in my rails app directory

easytags.vim 3.3.9: Vim(let):E684: list index out of range: 0 (at function xolox#easytags#update..<SNR>66_prep_cmdline, line 3)

This was indeed a bug. It should be fixed in version 3.3.11. Thanks for the report!

Owner

xolox commented Jun 22, 2013

I'm closing this issue now because I believe the original problem reported by @fcelda is resolved. If it's not, feel free to reopen this issue. Thanks for the feedback and happy Vimming!


@ixti:

Yhis one happened after i tried :UpdateTags -R . in my rails app directory

easytags.vim 3.3.9: Vim(let):E684: list index out of range: 0 (at function xolox#easytags#update..<SNR>66_prep_cmdline, line 3)

This was indeed a bug. It should be fixed in version 3.3.11. Thanks for the report!

@xolox xolox closed this Jun 22, 2013

@ixti

This comment has been minimized.

Show comment Hide comment
@ixti

ixti Jun 22, 2013

Thanks!

ixti commented Jun 22, 2013

Thanks!

@fcelda

This comment has been minimized.

Show comment Hide comment
@fcelda

fcelda Jun 22, 2013

Thank you, @xolox! The original report is fixed indeed. No wrong highlights inside preprocessor comments with 3.3.12.

fcelda commented Jun 22, 2013

Thank you, @xolox! The original report is fixed indeed. No wrong highlights inside preprocessor comments with 3.3.12.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment