lucc / nvimpager

Use nvim as a pager to view manpages, diffs, etc with nvim's syntax highlighting
Other
372 stars 20 forks source link

Getting errors when using as git pager #33

Closed kkga closed 3 years ago

kkga commented 3 years ago

I'm getting the following error whenever nvimpager is used for git. This only happens for git.

Not sure where to start inverstigating the cause of this, so any tips would be helpful.

Error detected while processing VimEnter Autocommands for "*":
E5108: Error executing lua /usr/share/nvimpager/runtime/lua/nvimpager.lua:338: Vim(setlocal):E519: Option not supported: hl=8:Ignore,~
:EndOfBuffer,z:TermCursor,Z:TermCursorNC,@:NonText,d:Directory,e:ErrorMsg,i:IncSearch,l:Search,m:MoreMsg,M:ModeMsg,n:LineNr,N:CursorLi
neNr,r:Question,s:StatusLine,S:StatusLineNC,c:VertSplit,t:Title,v:Visual,V:VisualNOS,w:WarningMsg,W:WildMenu,f:Folded,F:FoldColumn,A:D
iffAdd,C:DiffChange,D:DiffDelete,T:DiffText,>:SignColumn,-:Conceal,B:SpellBad,P:SpellCap,R:SpellRare,L:SpellLocal,+:Pmenu,=:PmenuSel,x
:PmenuSbar,X:PmenuThumb,*:TabLine,#:TabLineSel,_:TabLineFill,!:CursorColumn,.:CursorLine,o:ColorColumn,q:QuickFixLine,0:Whitespace,I:N
ormalNC
lucc commented 3 years ago

I assume you are using version 0.7 of nvimpager. What version of neovim are you using and what version is AnsiEsc ( /usr/share/nvimpager/runtime/plugin/AnsiEsc.vim around line 4). How did you install nvimpager?

kkga commented 3 years ago

Thanks for quick reply, here's some more info:

» nvimpager -v
nvimpager v0.7

» nvim -v
NVIM v0.5.0-dev
Build type: Release
LuaJIT 2.1.0-beta3
Compilation: /usr/bin/cc -fstack-clash-protection -D_FORTIFY_SOURCE=2 -mtune=generic -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -DNDEBUG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wshadow -Wconversion -Wmissing-prototypes -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fno-common -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -DMIN_LOG_LEVEL=3 -I/builddir/neovim-nightly/build/config -I/builddir/neovim-nightly/src -I/usr/include -I/builddir/neovim-nightly/build/src/nvim/auto -I/builddir/neovim-nightly/build/include
Compiled by kkga@void

» cat /usr/share/nvimpager/runtime/plugin/AnsiEscPlugin.vim | grep Version
"   Version: 12

nvimpager is installed from the Void Linux repository, here's the build template for it: https://github.com/void-linux/void-packages/blob/f35a6c2dee5b234c369fbada7181c86dbed2ab35/srcpkgs/nvimpager/template

lucc commented 3 years ago

Ok the version of AnsiEsc that the void packager is using is too old. It is from 2010 and they download it from vim.org. Please check the commit 871adb1e830756c1b093eaf1a39db8af4f211a3e. The makefile of nvimpager downloads ansiesc from the developers website. Sadly he does not version the tar balls so a static download link with a checksum does not exist. You can also try to port the patch I used before 871adb1e830756c1b093eaf1a39db8af4f211a3e.

I have been experimenting with different replacements for ansiesc because this situation did bother me before. Until now I did not finish one to my satisfaction. Maybe I should try again.

lucc commented 3 years ago

@kkga would you mind trying to run nvimpager from git? Just clone the repository, run make and try PATGER=/git/repository/nvimmpager git whatever-you-did-before. The makefile should download a newer version of the ansi esc plugin. Or you can try out the branch I dug up from my git history: https://github.com/lucc/nvimpager/tree/poc/ansi2term-2 That one works without the ansi esc plugin.

kkga commented 3 years ago

@lucc Tried cloning the repo and yes, it does work now! 👍

lucc commented 3 years ago

@kkga I am working on a replacement for the AnsiEsc plugin. If you want to help you can use the poc/ansi2syntax branch and try nvimpager from there. I am happy about any reports :)

kkga commented 3 years ago

just tried the new branch -- seems to be working fine for me :+1:

lucc commented 3 years ago

I merged the new ansi esc code into develop. With the next release that should be fixed.

lucc commented 3 years ago

The ansi-esc replacement is released in v0.9. @adrianisuru you seem to be the maintainer on Void Linux, so you could update the package (thanks for packaging btw :).