vim-patch:8.2.4095: sed script not recognized by the first line (#17101)

Problem:    Sed script not recognized by the first line.
Solution:   Recognize a sed script starting with "#n". (Doug Kearns)
e3ce17a3ca
This commit is contained in:
Christian Clason 2022-01-15 14:47:25 +01:00 committed by GitHub
parent 574a582202
commit c09147aad9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -406,6 +406,12 @@ else
elseif s:line1 =~# '^#.*by RouterOS.*$'
set ft=routeros
" Sed scripts
" #ncomment is allowed but most likely a false positive so require a space
" before any trailing comment text
elseif s:line1 =~# '^#n\%($\|\s\)'
set ft=sed
" CVS diff
else
let s:lnum = 1

View File

@ -653,7 +653,7 @@ let s:script_checks = {
\ ['#!/path/nodejs'],
\ ['#!/path/rhino']],
\ 'bc': [['#!/path/bc']],
\ 'sed': [['#!/path/sed']],
\ 'sed': [['#!/path/sed'], ['#n'], ['#n comment']],
\ 'ocaml': [['#!/path/ocaml']],
\ 'awk': [['#!/path/awk'],
\ ['#!/path/gawk']],