junegunn / fzf.vim

fzf :heart: vim
MIT License
9.62k stars 584 forks source link

:Helptags perl command failing #1506

Closed ColinKennedy closed 8 months ago

ColinKennedy commented 1 year ago

Issue

Calling :Helptags is erroring in the latest master

https://github.com/junegunn/fzf.vim/assets/10103049/1dd898e5-7261-4f10-b1a4-24585dd340ba

It's a bit hard to see the error with the preview window up. With let g:fzf_vim.preview_window = [] you can see a bit more but it's still cut off

[Command failed: perl '/tmp/nvim.selecaoone/PVLz9X/1' '/home/selecaoone/.local/share/nv

The last working tag is 5d87ac1fe8d729f116bda2f90a7211ad309ddf5a, before perl was introduced as a dependency in 1dcdb21db618055134cd611f4f5918f6d00a5df0. I've locked my version for now to the lower commit but any advice would be appreciated.

Reproduction

fzf - 0.42.0 (d471067) fzf.vim - latest default branch nvim --version - NVIM v0.9.0 perl --version - This is perl 5, version 16, subversion 3 (v5.16.3) built for x86_64-linux-thread-multi (with 44 registered patches, see perl -V for more detail)

More details using -V ``` Summary of my perl5 (revision 5 version 16 subversion 3) configuration: Platform: osname=linux, osvers=3.10.0-957.1.3.el7.x86_64, archname=x86_64-linux-thread-multi uname='linux x86-02.bsys.centos.org 3.10.0-957.1.3.el7.x86_64 #1 smp thu nov 29 14:49:43 utc 2018 x86_64 x86_64 x86_64 gnulinux ' config_args='-des -Doptimize=-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -Dccdlflags=-Wl,--enable-new-dtags -Dlddlflags=-shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -Wl,-z,relro -DDEBUGGING=-g -Dversion=5.16.3 -Dmyhostname=localhost -Dperladmin=root@localhost -Dcc=gcc -Dcf_by=Red Hat, Inc. -Dprefix=/usr -Dvendorprefix=/usr -Dsiteprefix=/usr/local -Dsitelib=/usr/local/share/perl5 -Dsitearch=/usr/local/lib64/perl5 -Dprivlib=/usr/share/perl5 -Dvendorlib=/usr/share/perl5/vendor_perl -Darchlib=/usr/lib64/perl5 -Dvendorarch=/usr/lib64/perl5/vendor_perl -Darchname=x86_64-linux-thread-multi -Dlibpth=/usr/local/lib64 /lib64 /usr/lib64 -Duseshrplib -Dusethreads -Duseithreads -Dusedtrace=/usr/bin/dtrace -Duselargefiles -Dd_semctl_semun -Di_db -Ui_ndbm -Di_gdbm -Di_shadow -Di_syslog -Dman3ext=3pm -Duseperlio -Dinstallusrbinperl=n -Ubincompat5005 -Uversiononly -Dpager=/usr/bin/less -isr -Dd_gethostent_r_proto -Ud_endhostent_r_proto -Ud_sethostent_r_proto -Ud_endprotoent_r_proto -Ud_setprotoent_r_proto -Ud_endservent_r_proto -Ud_setservent_r_proto -Dscriptdir=/usr/bin -Dusesitecustomize' hint=recommended, useposix=true, d_sigaction=define useithreads=define, usemultiplicity=define useperlio=define, d_sfio=undef, uselargefiles=define, usesocks=undef use64bitint=define, use64bitall=define, uselongdouble=undef usemymalloc=n, bincompat5005=undef Compiler: cc='gcc', ccflags ='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64', optimize='-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic', cppflags='-D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include' ccversion='', gccversion='4.8.5 20150623 (Red Hat 4.8.5-44)', gccosandvers='' intsize=4, longsize=8, ptrsize=8, doublesize=8, byteorder=12345678 d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=16 ivtype='long', ivsize=8, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8 alignbytes=8, prototype=define Linker and Libraries: ld='gcc', ldflags =' -fstack-protector' libpth=/usr/local/lib64 /lib64 /usr/lib64 libs=-lresolv -lnsl -lgdbm -ldb -ldl -lm -lcrypt -lutil -lpthread -lc -lgdbm_compat perllibs=-lresolv -lnsl -ldl -lm -lcrypt -lutil -lpthread -lc libc=, so=so, useshrplib=true, libperl=libperl.so gnulibc_version='2.17' Dynamic Linking: dlsrc=dl_dlopen.xs, dlext=so, d_dlsymun=undef, ccdlflags='-Wl,--enable-new-dtags -Wl,-rpath,/usr/lib64/perl5/CORE' cccdlflags='-fPIC', lddlflags='-shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -Wl,-z,relro ' Characteristics of this binary (from libperl): Compile-time options: HAS_TIMES MULTIPLICITY PERLIO_LAYERS PERL_DONT_CREATE_GVSV PERL_IMPLICIT_CONTEXT PERL_MALLOC_WRAP PERL_PRESERVE_IVUV USE_64_BIT_ALL USE_64_BIT_INT USE_ITHREADS USE_LARGE_FILES USE_LOCALE USE_LOCALE_COLLATE USE_LOCALE_CTYPE USE_LOCALE_NUMERIC USE_PERLIO USE_PERL_ATOF USE_REENTRANT_API USE_SITECUSTOMIZE Locally applied patches: Fedora Patch1: Removes date check, Fedora/RHEL specific Fedora Patch3: support for libdir64 Fedora Patch4: use libresolv instead of libbind Fedora Patch5: USE_MM_LD_RUN_PATH Fedora Patch6: Skip hostname tests, due to builders not being network capable Fedora Patch7: Dont run one io test due to random builder failures Fedora Patch9: Fix find2perl to translate ? glob properly (RT#113054) Fedora Patch10: Fix broken atof (RT#109318) Fedora Patch13: Clear $@ before "do" I/O error (RT#113730) Fedora Patch14: Do not truncate syscall() return value to 32 bits (RT#113980) Fedora Patch15: Override the Pod::Simple::parse_file (CPANRT#77530) Fedora Patch16: Do not leak with attribute on my variable (RT#114764) Fedora Patch17: Allow operator after numeric keyword argument (RT#105924) Fedora Patch18: Extend stack in File::Glob::glob, (RT#114984) Fedora Patch19: Do not crash when vivifying $| Fedora Patch20: Fix misparsing of maketext strings (CVE-2012-6329) Fedora Patch21: Add NAME headings to CPAN modules (CPANRT#73396) Fedora Patch22: Fix leaking tied hashes (RT#107000) [1] Fedora Patch23: Fix leaking tied hashes (RT#107000) [2] Fedora Patch24: Fix leaking tied hashes (RT#107000) [3] Fedora Patch25: Fix dead lock in PerlIO after fork from thread (RT#106212) Fedora Patch26: Make regexp safe in a signal handler (RT#114878) Fedora Patch27: Update h2ph(1) documentation (RT#117647) Fedora Patch28: Update pod2html(1) documentation (RT#117623) Fedora Patch29: Document Math::BigInt::CalcEmu requires Math::BigInt (CPAN RT#85015) RHEL Patch30: Use stronger algorithm needed for FIPS in t/op/crypt.t (RT#121591) RHEL Patch31: Make *DBM_File desctructors thread-safe (RT#61912) RHEL Patch32: Use stronger algorithm needed for FIPS in t/op/taint.t (RT#123338) RHEL Patch33: Remove CPU-speed-sensitive test in Benchmark test RHEL Patch34: Make File::Glob work with threads again RHEL Patch35: Fix CRLF conversion in ASCII FTP upload (CPAN RT#41642) RHEL Patch36: Do not leak the temp utf8 copy of namepv (CPAN RT#123786) RHEL Patch37: Fix duplicating PerlIO::encoding when spawning threads (RT#31923) RHEL Patch38: Add SSL support to Net::SMTP (CPAN RT#93823) [1] RHEL Patch39: Add SSL support to Net::SMTP (CPAN RT#93823) [2] RHEL Patch40: Add SSL support to Net::SMTP (CPAN RT#93823) [3] RHEL Patch41: Add SSL support to Net::SMTP (CPAN RT#93823) [4] RHEL Patch42: Do not overload ".." in Math::BigInt (CPAN RT#80182) RHEL Patch43: Fix CVE-2018-18311 Integer overflow leading to buffer overflow RHEL Patch44: Fix a spurious timeout in Net::FTP::close (CPAN RT#18504) RHEL Patch45: Fix day of year parsing (CPAN RT#88211) RHEL Patch47: Fix CVE-2020-12723 (GH#16947) RHEL Patch48: Fix CVE-2020-10543 RHEL Patch49: Fix CVE-2020-10878 Built under linux Compiled at Feb 2 2021 16:31:58 @INC: /usr/local/lib64/perl5 /usr/local/share/perl5 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5 . ```
junegunn commented 1 year ago

Not sure what went wrong. Can you temporarily change the code like below so you can manually test the command it runs?

diff --git a/autoload/fzf/vim.vim b/autoload/fzf/vim.vim
index bde1196..540d1e9 100755
--- a/autoload/fzf/vim.vim
+++ b/autoload/fzf/vim.vim
@@ -1306,11 +1306,14 @@ function! fzf#vim#helptags(...)
   if exists('s:helptags_script')
     silent! call delete(s:helptags_script)
   endif
-  let s:helptags_script = tempname()
+  let s:helptags_script = '/tmp/helptags.pl'
+  let command = 'perl '.fzf#shellescape(s:helptags_script).' '.join(map(tags, 'fzf#shellescape(v:val)'))
+  echom command
+  return

   call writefile(['use Fatal qw(open close); for my $filename (@ARGV) { open(my $file,q(<),$filename); while (<$file>) { /(.*?)\t(.*?)\t(.*)/; push @lines, sprintf(qq('.s:green('%-40s', 'Label').'\t%s\t%s\t%s\n), $1, $2, $filename, $3); } close($file); } print for sort @lines;'], s:helptags_script)
   return s:fzf('helptags', {
-  \ 'source': 'perl '.fzf#shellescape(s:helptags_script).' '.join(map(tags, 'fzf#shellescape(v:val)')),
+  \ 'source':  command,
   \ 'sink':    s:function('s:helptag_sink'),
   \ 'options': ['--ansi', '+m', '--tiebreak=begin', '--with-nth', '..3']}, a:000)
 endfunction
ColinKennedy commented 1 year ago

This is the print out from your suggested change

perl '/tmp/helptags.pl' '/home/selecaoone/.local/share/nvim/lazy/lazy.nvim/doc/tags' '/home/selecaoone/.local/state/nvim/lazy/readme/doc/tags' '/home/selecaoone/Downloads/squashfs-root/usr/share/nvim/runtime/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/Comment.nvim/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/LuaSnip/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/cmp-nvim-lsp/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/cmp-tmux/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/fidget.nvim/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/fzf.vim/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/fzf/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/grapple.nvim/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/hlargs.nvim/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/lsp_signature.nvim/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/lualine.nvim/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/mason.nvim/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/nvim-cmp/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/nvim-dap/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/nvim-lspconfig/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/nvim-treesitter-textobjects/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/nvim-treesitter/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/plenary.nvim/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/quick-scope/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/targets.vim/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/toggleterm.nvim/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/vim-indent-object/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/vim-operator-replace/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/vim-operator-user/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/vim-sleuth/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/vim-textobj-comment/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/vim-textobj-indent/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/vim-textobj-line/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/vim-textobj-user/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/vim-textobj-variable-segment/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/which-key.nvim/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/wilder.nvim/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/winbar.nvim/doc/tags'

Or, split into multi-lines

All lines ``` perl '/tmp/helptags.pl' '/home/selecaoone/.local/share/nvim/lazy/lazy.nvim/doc/tags' '/home/selecaoone/.local/state/nvim/lazy/readme/doc/tags' '/home/selecaoone/Downloads/squashfs-root/usr/share/nvim/runtime/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/Comment.nvim/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/LuaSnip/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/cmp-nvim-lsp/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/cmp-tmux/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/fidget.nvim/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/fzf.vim/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/fzf/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/grapple.nvim/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/hlargs.nvim/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/lsp_signature.nvim/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/lualine.nvim/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/mason.nvim/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/nvim-cmp/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/nvim-dap/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/nvim-lspconfig/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/nvim-treesitter-textobjects/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/nvim-treesitter/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/plenary.nvim/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/quick-scope/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/targets.vim/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/toggleterm.nvim/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/vim-indent-object/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/vim-operator-replace/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/vim-operator-user/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/vim-sleuth/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/vim-textobj-comment/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/vim-textobj-indent/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/vim-textobj-line/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/vim-textobj-user/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/vim-textobj-variable-segment/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/which-key.nvim/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/wilder.nvim/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/winbar.nvim/doc/tags' ```

Of those, the only plugin that stood out to me is '/home/selecaoone/personal/.config/nvim/bundle/winbar.nvim/doc/tags', which is empty. However it still fails even if I remove the plugin.

junegunn commented 1 year ago

Any idea why the command is failing? Any error messages?

ColinKennedy commented 1 year ago

Hey sorry, completely forgot to show you the output

See full command ``` selecaoone@selecaoone:~$ perl '/home/selecaoone/.local/share/nvim/lazy/lazy.nvim/doc/tags' '/home/selecaoone/.local/state/nvim/lazy/readme/doc/tags' '/home/selecaoone/Downloads/squashfs-root/usr/share/nvim/runtime/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/Comment.nvim/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/LuaSnip/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/cmp-nvim-lsp/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/cmp-tmux/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/fidget.nvim/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/fzf.vim/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/fzf/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/grapple.nvim/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/hlargs.nvim/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/lsp_signature.nvim/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/lualine.nvim/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/mason.nvim/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/nvim-cmp/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/nvim-dap/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/nvim-lspconfig/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/nvim-treesitter-textobjects/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/nvim-treesitter/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/plenary.nvim/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/quick-scope/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/targets.vim/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/toggleterm.nvim/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/vim-indent-object/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/vim-operator-replace/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/vim-operator-user/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/vim-sleuth/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/vim-textobj-comment/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/vim-textobj-indent/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/vim-textobj-line/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/vim-textobj-user/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/vim-textobj-variable-segment/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/which-key.nvim/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/wilder.nvim/doc/tags' '/home/selecaoone/personal/.config/nvim/bundle/winbar.nvim/doc/tags' Not enough arguments for lock at /home/selecaoone/.local/share/nvim/lazy/lazy.nvim/doc/tags line 7, near "lock." Not enough arguments for lock at /home/selecaoone/.local/share/nvim/lazy/lazy.nvim/doc/tags line 7, near "lock." syntax error at /home/selecaoone/.local/share/nvim/lazy/lazy.nvim/doc/tags line 18, at EOF Execution of /home/selecaoone/.local/share/nvim/lazy/lazy.nvim/doc/tags aborted due to compilation errors. ```

The error's at the bottom

Not enough arguments for lock at /home/selecaoone/.local/share/nvim/lazy/lazy.nvim/doc/tags line 7, near "lock."
Not enough arguments for lock at /home/selecaoone/.local/share/nvim/lazy/lazy.nvim/doc/tags line 7, near "lock."
syntax error at /home/selecaoone/.local/share/nvim/lazy/lazy.nvim/doc/tags line 18, at EOF
Execution of /home/selecaoone/.local/share/nvim/lazy/lazy.nvim/doc/tags aborted due to compilation errors.

Note: I removed /tmp/helptags.pl from the command because that seemed to not be necessary to reproduce an error and it seemed unrelated. I can run again with it, if you need.

This is the contents of the /home/selecaoone/.local/share/nvim/lazy/lazy.nvim/doc/tags file

lazy.nvim-lazy.nvim lazy.nvim.txt   /*lazy.nvim-lazy.nvim*
lazy.nvim-lazy.nvim-configuration   lazy.nvim.txt   /*lazy.nvim-lazy.nvim-configuration*
lazy.nvim-lazy.nvim-debug   lazy.nvim.txt   /*lazy.nvim-lazy.nvim-debug*
lazy.nvim-lazy.nvim-features    lazy.nvim.txt   /*lazy.nvim-lazy.nvim-features*
lazy.nvim-lazy.nvim-highlight-groups    lazy.nvim.txt   /*lazy.nvim-lazy.nvim-highlight-groups*
lazy.nvim-lazy.nvim-installation    lazy.nvim.txt   /*lazy.nvim-lazy.nvim-installation*
lazy.nvim-lazy.nvim-lockfile-lazy-lock.json lazy.nvim.txt   /*lazy.nvim-lazy.nvim-lockfile-lazy-lock.json*
lazy.nvim-lazy.nvim-migration-guide lazy.nvim.txt   /*lazy.nvim-lazy.nvim-migration-guide*
lazy.nvim-lazy.nvim-performance lazy.nvim.txt   /*lazy.nvim-lazy.nvim-performance*
lazy.nvim-lazy.nvim-plugin-spec lazy.nvim.txt   /*lazy.nvim-lazy.nvim-plugin-spec*
lazy.nvim-lazy.nvim-requirements    lazy.nvim.txt   /*lazy.nvim-lazy.nvim-requirements*
lazy.nvim-lazy.nvim-startup-sequence    lazy.nvim.txt   /*lazy.nvim-lazy.nvim-startup-sequence*
lazy.nvim-lazy.nvim-structuring-your-plugins    lazy.nvim.txt   /*lazy.nvim-lazy.nvim-structuring-your-plugins*
lazy.nvim-lazy.nvim-uninstalling    lazy.nvim.txt   /*lazy.nvim-lazy.nvim-uninstalling*
lazy.nvim-lazy.nvim-usage   lazy.nvim.txt   /*lazy.nvim-lazy.nvim-usage*
lazy.nvim-links lazy.nvim.txt   /*lazy.nvim-links*
lazy.nvim-table-of-contents lazy.nvim.txt   /*lazy.nvim-table-of-contents*
lazy.nvim.txt   lazy.nvim.txt   /*lazy.nvim.txt*
junegunn commented 1 year ago

Note: I removed /tmp/helptags.pl from the command because that seemed to not be necessary to reproduce an error and it seemed unrelated. I can run again with it, if you need.

It is necessary. It's the Perl script we're going to run. The rest of the arguments are passed as the arguments to that Perl script.

perl '/home/selecaoone/.local/share/nvim/lazy/lazy.nvim/doc/tags' ...

This command cannot run because the "tags" file is obviously not a Perl script.

schnittchen commented 9 months ago

Not sure what went wrong. Can you temporarily change the code like below so you can manually test the command it runs?

diff --git a/autoload/fzf/vim.vim b/autoload/fzf/vim.vim
index bde1196..540d1e9 100755
--- a/autoload/fzf/vim.vim
+++ b/autoload/fzf/vim.vim
@@ -1306,11 +1306,14 @@ function! fzf#vim#helptags(...)
   if exists('s:helptags_script')
     silent! call delete(s:helptags_script)
   endif
-  let s:helptags_script = tempname()
+  let s:helptags_script = '/tmp/helptags.pl'
+  let command = 'perl '.fzf#shellescape(s:helptags_script).' '.join(map(tags, 'fzf#shellescape(v:val)'))
+  echom command
+  return

   call writefile(['use Fatal qw(open close); for my $filename (@ARGV) { open(my $file,q(<),$filename); while (<$file>) { /(.*?)\t(.*?)\t(.*)/; push @lines, sprintf(qq('.s:green('%-40s', 'Label').'\t%s\t%s\t%s\n), $1, $2, $filename, $3); } close($file); } print for sort @lines;'], s:helptags_script)
   return s:fzf('helptags', {
-  \ 'source': 'perl '.fzf#shellescape(s:helptags_script).' '.join(map(tags, 'fzf#shellescape(v:val)')),
+  \ 'source':  command,
   \ 'sink':    s:function('s:helptag_sink'),
   \ 'options': ['--ansi', '+m', '--tiebreak=begin', '--with-nth', '..3']}, a:000)
 endfunction

I have the same problem on Vim 9. Your patch did not seem to work because /tmp/helptags.pl was not found

junegunn commented 9 months ago

Oh, I see. The return should be after the writefile line.

schnittchen commented 9 months ago

I get this error:

Can't locate Fatal.pm in @INC (you may need to install the Fatal module) (@INC entries checked: /usr/local/lib64/perl5/5.38 /usr/local/share/perl5/5.38 /usr/lib64/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib64/perl5 /usr/share/perl5) at /tmp/helptags.pl line 1.

After installing the perl-autodie package (I'm on Fedora 39), :Helptags works again

junegunn commented 8 months ago

Interesting. We can consider removing use Fatal as it doesn't really affect the result.

junegunn commented 8 months ago

Please let me know if this doesn't help with the situation.

schnittchen commented 8 months ago

Works, thank you!