Closed TonyWu20 closed 2 years ago
The current preview command does not put double quotes to the 'item.filename', which will cause an error when passed to bat if the file path contains space. Change the line
bat
local cmd = string.format('bat %s --color=always --paging=always --plain -n --pager="less -RS" -H %s -r %s:', item.filename, item.lnum, startPoint)
to
local cmd = string.format('bat "%s" --color=always --paging=always --plain -n --pager="less -RS" -H %s -r %s:', item.filename, item.lnum, startPoint)
LGTM Thanks
The current preview command does not put double quotes to the 'item.filename', which will cause an error when passed to
bat
if the file path contains space. Change the lineto