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

Backward range #64

Closed gudbjornv closed 3 years ago

gudbjornv commented 3 years ago

I get this error when I try to use the keymappings:

"Error detected while processing function limelight#operator: E493: Backward range given: '[,']call limelight#execute(0, 1)"

I am relatively new to this all so if this is a common problem caused by my stupidity I do apologize.

I just copied the nmap and xmap keymappings from the README.

junegunn commented 3 years ago

There was a bug in the normal mode map. I just fixed it in 2adb5e2caccd682b6043e1a9bc6105da495b1896. See if this helps in your case.

gudbjornv commented 3 years ago

No longer get the error after updating, but now when I toggle it using keybinding it only highlights one line and does'nt change when I move between lines/paragraphs. See here.

junegunn commented 3 years ago

Yep, that's expected. It implements a normal-mode operator you can combine with a motion. e.g. <leader>lip, <leader>lG, etc. If you're not familiar with the concept, just use :Limelight command instead of using the map. Or something like nnoremap <Leader>l :Limelight!!<cr>.