patch 8.2.4095: sed script not recognized by the first line
Problem: Sed script not recognized by the first line.
Solution: Recognize a sed script starting with "#n". (Doug Kearns)
diff --git a/runtime/scripts.vim b/runtime/scripts.vim
index e41405a..dd47f65 100644
--- a/runtime/scripts.vim
+++ b/runtime/scripts.vim
@@ -406,6 +406,12 @@
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
diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim
index 5a5ba5f..755eafc 100644
--- a/src/testdir/test_filetype.vim
+++ b/src/testdir/test_filetype.vim
@@ -654,7 +654,7 @@
\ ['#!/path/nodejs'],
\ ['#!/path/rhino']],
\ 'bc': [['#!/path/bc']],
- \ 'sed': [['#!/path/sed']],
+ \ 'sed': [['#!/path/sed'], ['#n'], ['#n comment']],
\ 'ocaml': [['#!/path/ocaml']],
\ 'awk': [['#!/path/awk'],
\ ['#!/path/gawk']],
diff --git a/src/version.c b/src/version.c
index e62c69d..733021b 100644
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 4095,
+/**/
4094,
/**/
4093,