neovim / neovim

Vim-fork focused on extensibility and usability
https://neovim.io
Other
83.16k stars 5.69k forks source link

man.lua: invalid return value from tagfunc when opening man pages #21421

Closed willeccles closed 1 year ago

willeccles commented 1 year ago

Neovim version (nvim -v)

NVIM v0.9.0-dev-507+g2a6101f5f (090048b)

Vim (not Nvim) behaves the same?

n/a

Operating system/version

Void Linux

Terminal name/version

Windows Terminal

$TERM environment variable

xterm-256color

Installation

built from repo

How to reproduce the issue

nvim --clean
:Man strlen

(Also broken with other pages, feel free to use the page of your choice.)

Expected behavior

Man page should open.

Actual behavior

Error detected while processing function man#open_page[43]..function man#open_page:
line   38:
E987: invalid return value from tagfunc
E426: tag not found: strlen(3)

This is using mandoc on void Linux. I had previously done extensive modifications to man.vim in #13709 to make sure that searching for man pages worked, which (as far as I can tell) have not broken since the lua upgrade. However, I do not recall having issues with tags previously.

Note that I did a clean install by deleting my runtime path when I rebuilt neovim today.

willeccles commented 1 year ago

To clarify the version, this is the latest nightly tag (090048b) with one patch applied on top of it (nothing even remotely related to man, lua, or anything else here).

zeertzjq commented 1 year ago

have not broken since the lua upgrade

Do you mean this is not caused by #19912?

willeccles commented 1 year ago

I'm guessing not. Given it mentions strlen(3), I'm assuming it's successfully finding the man page, as I never told it which section to look in. However, it appears something to do with tags(?) must have broken during the lua upgrade.

willeccles commented 1 year ago

I may have misinterpreted your message. I do think this bug was caused by #19912, but I do not think it broke search or that searching is related. Thus, I have to imagine it may not be a mandoc-related issue this time.

willeccles commented 1 year ago

I've just built the same version of nvim on Debian Sid (with man-db 2.11.1). Here it does not error, but it does take quite a while before it loads the man page (recording). So it does appear that this has something to do with Void's mandoc (or perhaps the contents of the man pages themselves?), but I am not familiar enough with the new lua implementation or how the tagging works to justify spending the time on a fix. If I'm honest, I'll probably end up taking a stab at it anyway, but no promises...

willeccles commented 1 year ago

Uh oh. Turns out when I removed the nvim runtime, I removed the one in /usr/share instead of the one in /usr/local/share by accident. As a result, I still had the old man.vim installed. Sorry for the confusion! Just good old user error and some system packages which will need to be reinstalled.

justinmk commented 1 year ago

As a result, I still had the old man.vim installed

Note that :checkhealth detects this and warns about it.