Closed sudo-nice closed 7 years ago
In case this helps others, the solution to the above is:
let g:limelight_bop = '^.*$'
let g:limelight_eop = '\n'
let g:limelight_paragraph_span = 0
@franckrasolo i'm still getting the problem with double line highlighting though
Again, in case this help others, I think @sudo-nice solution was OK but matching pattern '$' at the end of line does not work due to this line:
After changing it from let end = searchpos(eop, 'W')[0]
to let end = searchpos(eop, 'Wc')[0]
the problem with double line highlighting seems to be gone.
c
flag means:
'c' accept a match at the Cursor position
However it's probably worth noting - the speed is not great, especially while moving cursor up and down over a file with long lines.
Turned out this solution does not work properly if g:limelight_paragraph_span
is set value greater then 0 so I've reverted the flag change. Instead I've added moving cursor to the beginning of line (normal 0
) just before the for loop.
call setpos('.', pos)
normal 0
for _ in range(0, span)
let end = searchpos(eop, 'W')[0]
endfor
(Cursor position is restored later in the script)
This seems to be working fine with g:limelight_paragraph_span
@amariusz that solution breaks on single-character lines
aaaa
bbbb
cccc
a
b
c
Adding the c
flag back seems to solve it? I haven't tested this thoroughly.
Working config arguments seem to be the basic:
let g:limelight_bop = '^'
let g:limelight_eop = '$'
!normal 0 && !c-flag breaks g:limelight_paragraph_span == 0, status quo
!normal 0 && c-flag breaks g:limelight_paragraph_span != 0
normal 0 && !c-flag breaks g:limelight_paragraph_span != 0 for lines of single char
normal 0 && c-flag breaks g:limelight_paragraph_span != 0 (but works for == 0)
needs a separate fix to not break g:limelight_paragraph_span != 0
if you only need g:limelight_paragraph_span = 0
, however, it works
Thank you for a very helpful plugin. Could you, please, advice me a solution to get only the current line highlighted with limelight? My approaches are all around this config:
If the cursor moves not to the end of the next/previous line, it works well. Here the example where the cursor moved from the middle of line 1 to the middle of the line 2:![scr1](http://i.imgur.com/F3sdteX.png)
However if the cursor moves to the end of the next/previous line, the next line and the line after next get highlighted both:![scr2](http://i.imgur.com/Iz5GQ3z.png)
Have I overlooked any simple solution here?