Git Product home page Git Product logo

Comments (5)

Shougo avatar Shougo commented on August 22, 2024

This proposed change also requires a ), :, or ; character between one string of word characters and the next before trying Omni complete on the second string (but does not require a whitespace after those characters).

Please describe the change. Why it is needed?
I don't understand it.

from neocomplete.vim.

jsit avatar jsit commented on August 22, 2024

I guess I don't get what that second string is meant to do. This regex string:

\w\+[):;]\?\s\+\w*

Is (a) at least one word character, followed by (b) one or none of the ), :, or ; characters, followed by (c) at least one character of whitespace, followed by (d) at least 0 word characters.

It looks like this is supposed to be for when you have something like background: n, there is supposed to be Omni completion for that n; but because the [):;] is optional, it's activated for the first letter of any word that has another word before it. So it will activate for all the following strings:

div a
background: n
border: 1
/* Lorem i
color: red; b

What's odd, though, is that the space following [):;] is not optional, so Omni would not trigger on something like this:

color:r

I think I just don't get what this second string is meant to target that the first string isn't already targeting. Looking more closely at it, it seems like you could almost get rid of it, except maybe after a : character so that property values pop up earlier.

from neocomplete.vim.

Shougo avatar Shougo commented on August 22, 2024

Well, I get it.

But it is not too agressive?

Omni completion starts in CSS and SCSS files when a single character is typed, which is too aggressive in my opinion. Ideally, I think this should obey the g:neocomplete#min_keyword_length setting.

Please describe why \w\+ is too agressive, but \w\+[):;]\s*\w* is not.

from neocomplete.vim.

jsit avatar jsit commented on August 22, 2024

Please describe why \w\+ is too agressive, but \w\+[):;]\s*\w* is not.

I think because, at least with :, you know the user is starting a property value, of which there are limited options. But maybe it should be tied to g:neocomplete#min_keyword_length, too. Why even have that second string (\w\+[):;]\s*\w*)? What are some example use cases for it?

from neocomplete.vim.

Shougo avatar Shougo commented on August 22, 2024

I don't write CSS.
The pattern was added long ago by other people.

So I need CSS writer's demand.

from neocomplete.vim.

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.