Code Monkey home page Code Monkey logo

Comments (12)

acidjazz avatar acidjazz commented on May 30, 2024

Here is another example for more info (JADE templating vim plugin)

Link to conflicting plugin

No indentline:
image

With indentline:
image

from indentline.

Yggdroot avatar Yggdroot commented on May 30, 2024

Can you give me a sample of stylus file?

from indentline.

acidjazz avatar acidjazz commented on May 30, 2024

Absolutely, here is an example pulled from my footer:

.footer
  background-color by_black
  color white
  padding 1em
  margin 1em 0
  itemwidth = 110
  > .menu
    width (itemwidth*3+10)px
    margin auto
    > .item
      display inline-block
      width unit(itemwidth, px)
      text-align center

here is what it looks like normally in vim w/out the indent plugin using the stylus plugin i urled at the top:

image

from indentline.

Yggdroot avatar Yggdroot commented on May 30, 2024

If you want these two plugin to work together, you'd better make some changes for vim-stylus.
For example,

syn match stylusProperty "^\s*\zs\s\%(\%([[:alnum:]-]\|#{[^{}]*}\)\+[ :]\|:[[:alnum:]-]\+\)"hs=s+1 contains=@stylusCssProperties,@stylusCssSelectors skipwhite nextgroup=stylusCssAttribute
syn match stylusProperty "^\s*\zs\s\%(:\=[[:alnum:]-]\+\s*=\)"hs=s+1 contains=@stylusCssProperties,@stylusCssSelectors skipwhite nextgroup=stylusCssAttribute
    =>
syn match stylusProperty "\(^\s*\)\@<=\%(\%([[:alnum:]-]\|#{[^{}]*}\)\+[ :]\|:[[:alnum:]-]\+\)"hs=s+1 contains=@stylusCssProperties,@stylusCssSelectors skipwhite nextgroup=stylusCssAttribute
syn match stylusProperty "\(^\s*\)\@<=\%(:\=[[:alnum:]-]\+\s*=\)"hs=s+1 contains=@stylusCssProperties,@stylusCssSelectors skipwhite nextgroup=stylusCssAttribute

in syntax/stylus.vim line:330

from indentline.

acidjazz avatar acidjazz commented on May 30, 2024

Nice work! are you sure this is the only solution? there are a couple other syntax plugins broken IIRC after trying this out.

from indentline.

Yggdroot avatar Yggdroot commented on May 30, 2024

This is not the only solution, but this solution only need to change little code.

from indentline.

Yggdroot avatar Yggdroot commented on May 30, 2024

I think this issue can be closed.

from indentline.

acidjazz avatar acidjazz commented on May 30, 2024

well, not really a little code because I have to do this for each syntax file that it breaks, its a little change that's never ending. It still pretty much means this plugin is not compatible with a lot of syntax highlight files.

from indentline.

acidjazz avatar acidjazz commented on May 30, 2024

There are two other syntax plugins I'm using that are also now broken because of this, I think this bug is actually a pretty high priority, and should be re-opened.

from indentline.

Yggdroot avatar Yggdroot commented on May 30, 2024

I think it's impossible to resolve this issue through modifying indentLine only.
'help syn-priority' says:

When several syntax items may match, these rules are used:
1. When multiple Match or Region items start in the same position, the item  defined last has priority.
2. A Keyword has priority over Match and Region items.
3. An item that starts in an earlier position has priority over items that start in later positions.

Some syntax plugins have 'syn match xxx /^\s*xxxxxxxx/' which matchs the same position as indentLine, so the highlighting is overruled by indentLine(because indentLine is in the after directory). The issue is either indentLine's highlighting is overruled by other syntax plugin or indentLine's highlighting overrules other syntax plugin. The only solution is that let 'syn match xxx /^\s*xxxxxxxx/' matches different position, it can be achieved by using \@<=.

from indentline.

acidjazz avatar acidjazz commented on May 30, 2024

Thank you for clarifying, I will echo this to the following repo's and hopefully get them to resolve this.

from indentline.

acidjazz avatar acidjazz commented on May 30, 2024

Just to clarify then with jade, am i right that the issue is here :

https://github.com/digitaltoad/vim-jade/blob/master/syntax/jade.vim#L32

And that I need to alter that to \@<= ?

from indentline.

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.