Created attachment 832789 [details, diff] vim filetype indent perl patch Please include attached patch to app-editors/vim-core-9.0.* Since vim-9.0.*, perl code indent is broken when using filetype plugin indent on syntax enable in /etc/vim/vimrc.local $ vim /tmp/hello1.pl #!/usr/bin/perl main(); sub main { print "hello\n"; # hello } I found https://github.com/vim-perl/vim-perl/issues/267#issuecomment-803380012 and created/implemented a patch, see attachment. It simply adds a single (but essential) line for perlFiledescStatement in /usr/share/vim/vim90/indent/perl.vim After implementing the patch, perl code indent behaves correctly: $ vim /tmp/hello2.pl #!/usr/bin/perl main(); sub main { print "hello\n"; # hello } I found multiple URLs stating to use filetype plugin indent on syntax enable but in the current state, especially "filetype indent on" only breaks perl indent. I was able to workaround using cindent/cinkeys etc. however, this patch really fixes it. Note: since vim-9.0.* my bash indent was broken too but filetype plugin indent on also fixes that issue.
Thanks for the report. Is the idea that vim-perl is bundled in vim and periodicially vim upstream will pull in a new version?
I guess so. However, I expect years to pass before the patch makes it into vim upstream. 2021-03-20 patch was suggested 2022-04-27 patch was committed 5bca914 (dev branch vim-perl.git) Seeing - the patch took over one year to be committed in dev vim-perl.git - gentoo uses vim.git - vim-perl.git master & release-prep branch are dated 2017-09-12 It wouldn't surprise me another couple of years to pass before the patch finally makes it into vim upstream. So I would appreciate the patch to be included into app-editors/vim-core so all Gentoo users can benefit. Note: Since vim-9.0, smartindent is broken (at least for bash & perl). This triggered me for the research.
(In reply to Evert from comment #2) Sure, I wasn't saying no -- just wanted to understand the situation.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5e288b5eef64b3cb8d6fae135f98b88cb09109f1 commit 5e288b5eef64b3cb8d6fae135f98b88cb09109f1 Author: Sam James <sam@gentoo.org> AuthorDate: 2022-12-05 04:35:52 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-12-05 04:35:52 +0000 app-editors/vim: use latest patchset (Perl fix) Use latest vim-patches for Perl highlighting fix. Should be no functional change as it only matters in vim-core. Closes: https://bugs.gentoo.org/881385 Signed-off-by: Sam James <sam@gentoo.org> app-editors/vim/Manifest | 1 + app-editors/vim/vim-9.0.1000.ebuild | 6 ++++-- app-editors/vim/vim-9999.ebuild | 7 ++++--- 3 files changed, 9 insertions(+), 5 deletions(-) https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=76cbe77db7c98d2d1147bd77a1cca25cba627083 commit 76cbe77db7c98d2d1147bd77a1cca25cba627083 Author: Sam James <sam@gentoo.org> AuthorDate: 2022-12-05 04:31:31 +0000 Commit: Sam James <sam@gentoo.org> CommitDate: 2022-12-05 04:31:31 +0000 app-editors/vim-core: backport Perl highlighting fix Closes: https://bugs.gentoo.org/881385 Signed-off-by: Sam James <sam@gentoo.org> app-editors/vim-core/Manifest | 1 + app-editors/vim-core/vim-core-9.0.1000.ebuild | 5 +++-- app-editors/vim-core/vim-core-9999.ebuild | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-)
Thanks :)