Giter Club home page Giter Club logo

Comments (5)

bfrg avatar bfrg commented on May 28, 2024 1

Any word that appears before an opening parenthesis is highlighted as a function. The highlighting of functions is purely regex-based. I deliberately didn't add the function names from the standard library because there are just too many and often the names collide with some types or user-defined variables (I noticed this in the past with vim-cpp-enhanced-highlight - one of the reason I started this repo). In most cases the current approach works fine, your example above is one of the exceptions. If you need more accurate highlighting, you need to look for a LSP plugin that supports semantic highlighting.

from vim-cpp-modern.

Bbllaaddee avatar Bbllaaddee commented on May 28, 2024

Experimented a bit, it seems that only types are highlighted...

from vim-cpp-modern.

bfrg avatar bfrg commented on May 28, 2024

Can you show example code?

Functions are highlighted with let g:cpp_no_function_highlight = 0. Let me change the variable to g:cpp_function_highlight. The negation is confusing.

from vim-cpp-modern.

bfrg avatar bfrg commented on May 28, 2024

If you have code like std::ref(foo), ref will be highlighted as Function by default.

from vim-cpp-modern.

Bbllaaddee avatar Bbllaaddee commented on May 28, 2024

Hey there!

What I meant was it is not highlighted when used without parentheses, for example, if you pass a function to an algorithm.

Like

std::transform(vec.begin(), vec.end(), vec.begin(), sqrt);

The sqrt, which is a member of the std is not highlighted (just an example).
Although, I'm not sure, if that's a good idea)

from vim-cpp-modern.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.