To: vim_dev@googlegroups.com Subject: Patch 9.0.1620 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 9.0.1620 Problem: Nix files are not recognized from the hashbang line. Solution: Add a hashbang check. (issue #12507) Files: runtime/autoload/dist/script.vim, src/testdir/test_filetype.vim *** ../vim-9.0.1619/runtime/autoload/dist/script.vim 2023-05-06 21:21:48.400778151 +0100 --- runtime/autoload/dist/script.vim 2023-06-08 21:20:35.192369941 +0100 *************** *** 4,10 **** # Invoked from "scripts.vim" in 'runtimepath' # # Maintainer: Bram Moolenaar ! # Last Change: 2022 Feb 13 export def DetectFiletype() var line1 = getline(1) --- 4,10 ---- # Invoked from "scripts.vim" in 'runtimepath' # # Maintainer: Bram Moolenaar ! # Last Change: 2023 Jun 08 export def DetectFiletype() var line1 = getline(1) *************** *** 44,50 **** elseif line1 =~ '^#!\s*[^/\\ ]*\>\([^/\\]\|$\)' name = substitute(line1, '^#!\s*\([^/\\ ]*\>\).*', '\1', '') else ! name = substitute(line1, '^#!\s*\S*[/\\]\(\i\+\).*', '\1', '') endif # tcl scripts may have #!/bin/sh in the first line and "exec wish" in the --- 44,50 ---- elseif line1 =~ '^#!\s*[^/\\ ]*\>\([^/\\]\|$\)' name = substitute(line1, '^#!\s*\([^/\\ ]*\>\).*', '\1', '') else ! name = substitute(line1, '^#!\s*\S*[/\\]\(\f\+\).*', '\1', '') endif # tcl scripts may have #!/bin/sh in the first line and "exec wish" in the *************** *** 197,202 **** --- 197,206 ---- elseif name =~ 'guile' setl ft=scheme + # Nix + elseif name =~ 'nix-shell' + setl ft=nix + endif enddef *** ../vim-9.0.1619/src/testdir/test_filetype.vim 2023-06-08 17:57:15.121742166 +0100 --- src/testdir/test_filetype.vim 2023-06-08 19:53:00.474048870 +0100 *************** *** 852,857 **** --- 852,858 ---- expect: [['#!/path/expect']], gnuplot: [['#!/path/gnuplot']], make: [['#!/path/make']], + nix: [['#!/path/nix-shell']], pike: [['#!/path/pike'], ['#!/path/pike0'], ['#!/path/pike9']], *************** *** 902,907 **** --- 903,909 ---- scheme: [['#!/usr/bin/env VAR=val --ignore-environment scheme']], python: [['#!/usr/bin/env VAR=val -S python -w -T']], wml: [['#!/usr/bin/env VAR=val --split-string wml']], + nix: [['#!/usr/bin/env nix-shell']], } enddef *** ../vim-9.0.1619/src/version.c 2023-06-08 18:43:55.771781364 +0100 --- src/version.c 2023-06-08 19:39:04.062799054 +0100 *************** *** 697,698 **** --- 697,700 ---- { /* Add new patch number below this line */ + /**/ + 1620, /**/ -- hundred-and-one symptoms of being an internet addict: 136. You decide to stay in a low-paying job teaching just for the free Internet access. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///