runtime(perl): Update ftplugin and indent files (#13052)

Commit: 
https://github.com/vim/vim/commit/4e554d282c50e428932df5fff9917f8a836f7782
Author: dkearns <[email protected]>
Date:   Sat Sep 9 03:16:03 2023 +1000

    runtime(perl): Update ftplugin and indent files 
(https://github.com/vim/vim/issues/13052)
    
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/runtime/ftplugin/perl.vim b/runtime/ftplugin/perl.vim
index f3de81deb..7ea0ae980 100644
--- a/runtime/ftplugin/perl.vim
+++ b/runtime/ftplugin/perl.vim
@@ -5,6 +5,8 @@
 " Bugs/requests: https://github.com/vim-perl/vim-perl/issues
 " License:       Vim License (see :help license)
 " Last Change:   2021 Nov 10
+"                2023 Sep 07 by Vim Project (safety check: don't execute perl
+"                    from current directory)
 
 if exists("b:did_ftplugin") | finish | endif
 let b:did_ftplugin = 1
diff --git a/runtime/ftplugin/pod.vim b/runtime/ftplugin/pod.vim
index 2a905ab35..61a4aa094 100644
--- a/runtime/ftplugin/pod.vim
+++ b/runtime/ftplugin/pod.vim
@@ -5,11 +5,12 @@
 " Homepage:      https://github.com/vim-perl/vim-perl
 " Bugs/requests: https://github.com/vim-perl/vim-perl/issues
 " License:       Vim License (see :help license)
-" Last Change:   2021 Oct 19
+" Last Change:   2023 Jul 05
 
 if exists("b:did_ftplugin")
-    finish
+  finish
 endif
+let b:did_ftplugin = 1
 
 let s:save_cpo = &cpo
 set cpo-=C
@@ -37,12 +38,12 @@ if (has("gui_win32") || has("gui_gtk")) && 
!exists("b:browsefilter")
   let b:undo_ftplugin .= " | unlet! b:browsefilter"
 endif
 
-function! s:jumpToSection(backwards)
-  let flags = a:backwards ? 'bsWz' : 'sWz'
-  if has('syntax_items')
+function s:jumpToSection(direction)
+  let flags = a:direction == "backward" ? "bsWz" : "sWz"
+  if has("syntax_items")
     let skip = "synIDattr(synID(line('.'), col('.'), 1), 'name') !~# 
'\<podCommand\>'"
   else
-    let skip = ''
+    let skip = ""
   endif
   for i in range(v:count1)
     call search('^= ', flags, 0, 0, skip)
@@ -50,19 +51,17 @@ function! s:jumpToSection(backwards)
 endfunction
 
 if !exists("no_plugin_maps") && !exists("no_pod_maps")
-  nnoremap <silent> <buffer> ]] <Cmd>call <SID>jumpToSection()<CR>
-  vnoremap <silent> <buffer> ]] <Cmd>call <SID>jumpToSection()<CR>
-  nnoremap <silent> <buffer> ][ <Cmd>call <SID>jumpToSection()<CR>
-  vnoremap <silent> <buffer> ][ <Cmd>call <SID>jumpToSection()<CR>
-  nnoremap <silent> <buffer> [[ <Cmd>call <SID>jumpToSection(1)<CR>
-  vnoremap <silent> <buffer> [[ <Cmd>call <SID>jumpToSection(1)<CR>
-  nnoremap <silent> <buffer> [] <Cmd>call <SID>jumpToSection(1)<CR>
-  vnoremap <silent> <buffer> [] <Cmd>call <SID>jumpToSection(1)<CR>
-  let b:undo_ftplugin .=
-        \ " | silent! exe 'nunmap <buffer> ]]' | silent! exe 'vunmap <buffer> 
]]'" .
-        \ " | silent! exe 'nunmap <buffer> ][' | silent! exe 'vunmap <buffer> 
]['" .
-        \ " | silent! exe 'nunmap <buffer> ]]' | silent! exe 'vunmap <buffer> 
]]'" .
-        \ " | silent! exe 'nunmap <buffer> []' | silent! exe 'vunmap <buffer> 
[]'"
+  for s:mode in ["n", "o", "x"]
+    for s:lhs in ["]]", "]["]
+      execute s:mode . "noremap <silent> <buffer> " . s:lhs . " <Cmd>call 
<SID>jumpToSection('forward')<CR>"
+      let b:undo_ftplugin .= " | silent! execute '" . s:mode . "unmap <buffer> 
" . s:lhs . "'"
+    endfor
+    for s:lhs in ["[[", "[]"]
+      execute s:mode . "noremap <silent> <buffer> " . s:lhs . " <Cmd>call 
<SID>jumpToSection('backward')<CR>"
+      let b:undo_ftplugin .= " | silent! execute '" . s:mode . "unmap <buffer> 
" . s:lhs . "'"
+    endfor
+  endfor
+  unlet s:mode s:lhs
 endif
 
 let &cpo = s:save_cpo
diff --git a/runtime/indent/perl.vim b/runtime/indent/perl.vim
index 4c91fa1b3..a97c34da5 100644
--- a/runtime/indent/perl.vim
+++ b/runtime/indent/perl.vim
@@ -4,7 +4,7 @@
 " Homepage:      https://github.com/vim-perl/vim-perl
 " Bugs/requests: https://github.com/vim-perl/vim-perl/issues
 " License:       Vim License (see :help license)
-" Last Change:   2021 Sep 24
+" Last Change:   2022 Jun 14
 
 " Suggestions and improvements by :
 "   Aaron J. Sherman (use syntax for hints)
@@ -133,6 +133,7 @@ function! GetPerlIndent()
                         \ || synid == "perlHereDoc"
                         \ || synid == "perlBraces"
                         \ || synid == "perlStatementIndirObj"
+                        \ || synid == "perlSubDeclaration"
                         \ || synid =~ "^perlFiledescStatement"
                         \ || synid =~ '^perl\(Sub\|Block\|Package\)Fold'
                 let brace = strpart(line, bracepos, 1)

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/E1qefIz-003WVr-31%40256bit.org.

Raspunde prin e-mail lui