Giter Site home page Giter Site logo

Not keyword is not highlighted about vim-fish HOT 4 CLOSED

dag avatar dag commented on July 16, 2024
Not keyword is not highlighted

from vim-fish.

Comments (4)

karlek avatar karlek commented on July 16, 2024

It looks like the fix is to add not to fishConditional here: https://github.com/dag/vim-fish/blob/825853f4816a07e59ea2ecee1190ab6a5d9ef991/syntax/fish.vim

from vim-fish.

dag avatar dag commented on July 16, 2024

No, you'd have to put it in fishLineContinuation, which would mean it gets highlighted everywhere, as an argument to any command. Note that not gets highlighted correctly if it's on its own; problem is if works like sudo and other such commands that wrap other commands. Thus, not is technically just a string argument to if and it's technically correct not to highlight it as anything other than a string argument. You could make a special syntax rule for if but that gets hairy fast with Vim syntax rules, and tends to be slow. I decided against that for vim-fish.

from vim-fish.

dag avatar dag commented on July 16, 2024

The other way to do it is to drop fishLineContinuation all-together and just make things like not keywords. But then a line like echo if begin function end highlights like a bunch of keywords, even though only echo was anything other than a string argument. I decided it was more helpful to ensure that nothing is incorrectly highlighted as a keyword, than to ensure that anything that possibly ever could be a keyword always gets highlighted as such.

from vim-fish.

karlek avatar karlek commented on July 16, 2024

Good conclusion. It's better to not highlight keywords incorrectly.

from vim-fish.

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.