lucc/nvimpager

nvimpager fails when executed without options in a script

Closed this issue · 5 comments

ivanp7 commented

I have a script:

#!/bin/sh
exec nvimpager -p -- "$@"

It works, but when I remove -p, nvimpager fails:

Error detected while processing VimEnter Autocommands for "*":
E5108: Error executing lua /usr/share/nvimpager/runtime/lua/nvimpager.lua:147: attempt to call upvalue 'color2escape' (a nil value)
stack traceback:
    /usr/share/nvimpager/runtime/lua/nvimpager.lua:147: in function 'group2ansi'
    /usr/share/nvimpager/runtime/lua/nvimpager.lua:161: in function 'init_cat_mode'
    /usr/share/nvimpager/runtime/lua/nvimpager.lua:297: in function 'cat_mode'
    [string ":lua"]:1: in main chunk

and prints nothing.

lucc commented

I can not reproduce this. Can you tell me which version of nvimpager you have and how you are calling your script?

ivanp7 commented

My nvimpager is nvimpager v0.10.4-18-g7a0b5dd, installed from AUR as nvimpager-git

I can run ls | nvimpager and get the error.

P.S. So mentioning of the script was redundant, I get the error using just /usr/bin/nvimpager
P.P.S. I have been using my script with nvimpager -p for a long time and cannot confirm whether the error was present all that time or not.

lucc commented

Your version is from 2022-01,can you please update to the newest version.

ivanp7 commented

My bad, I have assumed that the package was the latest version. I will try the new version and post the result.

ivanp7 commented

Yep, the problem went away. Thanks for helping out.