junegunn / limelight.vim

:flashlight: All the world's indeed a stage and we are merely players
MIT License
2.36k stars 53 forks source link

Different spans for beginning and end of paragraphs #58

Open diamondburned opened 5 years ago

diamondburned commented 5 years ago

Title has it, but just to elaborate, I was trying to make Limelight highlight the comments and the function block. I have this following snippet:

let g:limelight_bop = '\(\n\n^\/\/ .*\n\|^\w.*\(:\|{\|)\)\n\)'
let g:limelight_eop = '\(\n\n\/\/\|^\p\n\n\)'

The issue is the bop regex has 2 results, which means to grab the comments as well, the span needs to be 1. However, if 1 is used for the span of eop, the second code block will be included as well.

aviloff commented 2 years ago

I have the same problem trying to isolate one line using the answer of https://github.com/junegunn/limelight.vim/issues/40

It's the right answer, as I couldn't really improve to fix this bug

There seems to be some special function here that could help https://github.com/junegunn/limelight.vim/pull/59 but I'm not sure how to implement it properly