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

C++11 Initializer Lists marked with error style #10

Closed
unphased opened this issue May 16, 2015 · 12 comments
Closed

C++11 Initializer Lists marked with error style #10

unphased opened this issue May 16, 2015 · 12 comments

Comments

@unphased
Copy link

syntax-highlight-fail

@unphased unphased changed the title Initializer Lists marked with error style C++11 Initializer Lists marked with error style May 16, 2015
@unphased
Copy link
Author

The solution is inside of this.

https://github.com/vim-scripts/Cpp11-Syntax-Support

It should be pretty easy to merge the syntax between these two plugins.

@unphased unphased reopened this May 16, 2015
@unphased
Copy link
Author

Reopening because there is nothing out of the box that gives as much color as cpp-enhanced-highlight and which supports e.g. c++11 initializer list shenanigans. Note for the c++11 plugin you have to use set ft=cpp11 etc.

@octol
Copy link
Owner

octol commented May 17, 2015

I'm not able to reproduce the above results on my side. Is your cpp.vim up to date?

@unphased
Copy link
Author

I see that the latest cpp.vim bundled with vanilla vim from Mercurial is dated 2015 Mar 1.

Likely the one I was using that had the issue shown in the OP is a cpp.vim dated 2014 May 14. This somewhat-old one is here on my system: /usr/local/share/vim/vim74/syntax/cpp.vim. It is also here: /usr/local/share/nvim/runtime/syntax/cpp.vim.

In fact, I have way too many versions of these files. There are 4 versions, the second one from the left is the cpp.vim from the plugin I linked (although with my own modifications to make it "stack" on any existing cpp syntax).

screenshot 2015-05-17 20 52 46

It does appear to me that some order of sourcing all or most of them will yield a better syntax experience than any single one.

@rr-
Copy link

rr- commented Aug 8, 2015

This doesn't work for me as well on fresh vim-cpp-enhanced-highlight install.

@beatmax
Copy link

beatmax commented Aug 10, 2015

Something like "unordered_set({4,3})" works fine for me, but I still have this case where the curly brackets are red (my Key class has a constructor that takes an initializer_list):

std::map<Key, int> map;
map[Key{"hi", "there"}] = 2;

@rr-
Copy link

rr- commented Aug 10, 2015

I forgot to mention this, but my use case is the same as @beatmax's.

@octol
Copy link
Owner

octol commented Aug 17, 2015

Sorry, that std::map example works fine here. I'm using vim in Debian (testing), where my cpp.vim file seems to be last updated 2015-03-01. Upstream for the cpp.vim bundled with Debain is https://github.com/vim-jp/vim-cpp

@rr-
Copy link

rr- commented Aug 17, 2015

It has the same issue, though... vim-jp/vim-cpp#16

@octol
Copy link
Owner

octol commented Aug 17, 2015

@rr-, interesting. I wonder why I don't see it.

@octol
Copy link
Owner

octol commented Sep 19, 2015

Well turns out the reason I've not been able to reproduce it is that I set let c_no_curly_error=1 in my .vimrc. I'm thinking this is more a problem with the core cpp.vim.

@octol
Copy link
Owner

octol commented Oct 19, 2016

Since there is a workaround, I'm closing this for now.

@octol octol closed this as completed Oct 19, 2016
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

4 participants