aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <janedmundlazo@hotmail.com>2018-09-18 21:20:51 -0400
committerJan Edmund Lazo <janedmundlazo@hotmail.com>2018-10-27 19:53:17 -0400
commitf1f036740a89d7bece1fa7754bfeaad51220e5c7 (patch)
tree44425ba21351a8d72d10d52639f6f23347cedee7
parent5ec671d541da52bf98b3410f9750ab9da540153b (diff)
downloadrneovim-f1f036740a89d7bece1fa7754bfeaad51220e5c7.tar.gz
rneovim-f1f036740a89d7bece1fa7754bfeaad51220e5c7.tar.bz2
rneovim-f1f036740a89d7bece1fa7754bfeaad51220e5c7.zip
vim-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. https://github.com/vim/vim/commit/4bc0bed53695ac67db8d601f2a15e48e7a196688
-rw-r--r--runtime/scripts.vim2
-rw-r--r--src/nvim/testdir/test_filetype.vim5
2 files changed, 5 insertions, 2 deletions
diff --git a/runtime/scripts.vim b/runtime/scripts.vim
index 3279b58a47..ab66c0c0a1 100644
--- a/runtime/scripts.vim
+++ b/runtime/scripts.vim
@@ -133,7 +133,7 @@ if s:line1 =~# "^#!"
set ft=ruby
" JavaScript
- elseif s:name =~# 'node\(js\)\=\>' || s:name =~# 'rhino\>'
+ elseif s:name =~# 'node\(js\)\=\>\|js\>' || s:name =~# 'rhino\>'
set ft=javascript
" BC calculator
diff --git a/src/nvim/testdir/test_filetype.vim b/src/nvim/testdir/test_filetype.vim
index eab9af1d76..cfdd4b889d 100644
--- a/src/nvim/testdir/test_filetype.vim
+++ b/src/nvim/testdir/test_filetype.vim
@@ -560,10 +560,13 @@ let s:script_checks = {
\ 'perl6': [['#!/path/perl6']],
\ 'perl': [['#!/path/perl']],
\ 'php': [['#!/path/php']],
- \ 'python': [['#!/path/python']],
+ \ 'python': [['#!/path/python'],
+ \ ['#!/path/python2'],
+ \ ['#!/path/python3']],
\ 'groovy': [['#!/path/groovy']],
\ 'ruby': [['#!/path/ruby']],
\ 'javascript': [['#!/path/node'],
+ \ ['#!/path/js'],
\ ['#!/path/nodejs'],
\ ['#!/path/rhino']],
\ 'bc': [['#!/path/bc']],