Skip to content

Commit 4bc0bed

Browse files
committed
patch 8.0.1465: python2 and python3 detection not tested
Problem: Python2 and python3 detection not tested. (Matej Cepl) Solution: Add test for detecting python2 and python3. Also detect a script using "js" as javascript.
1 parent 8a37b03 commit 4bc0bed

3 files changed

Lines changed: 7 additions & 2 deletions

File tree

runtime/scripts.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ if s:line1 =~# "^#!"
137137
set ft=ruby
138138

139139
" JavaScript
140-
elseif s:name =~# 'node\(js\)\=\>' || s:name =~# 'rhino\>'
140+
elseif s:name =~# 'node\(js\)\=\>\|js\>' || s:name =~# 'rhino\>'
141141
set ft=javascript
142142

143143
" BC calculator

src/testdir/test_filetype.vim

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -561,10 +561,13 @@ let s:script_checks = {
561561
\ 'perl6': [['#!/path/perl6']],
562562
\ 'perl': [['#!/path/perl']],
563563
\ 'php': [['#!/path/php']],
564-
\ 'python': [['#!/path/python']],
564+
\ 'python': [['#!/path/python'],
565+
\ ['#!/path/python2'],
566+
\ ['#!/path/python3']],
565567
\ 'groovy': [['#!/path/groovy']],
566568
\ 'ruby': [['#!/path/ruby']],
567569
\ 'javascript': [['#!/path/node'],
570+
\ ['#!/path/js'],
568571
\ ['#!/path/nodejs'],
569572
\ ['#!/path/rhino']],
570573
\ 'bc': [['#!/path/bc']],

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -771,6 +771,8 @@ static char *(features[]) =
771771

772772
static int included_patches[] =
773773
{ /* Add new patch number below this line */
774+
/**/
775+
1465,
774776
/**/
775777
1464,
776778
/**/

0 commit comments

Comments
 (0)