From 4c028b37bf97294710b3ef55ea2a3ec84a1b7a3d Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Thu, 24 Sep 2020 18:56:07 +0200 Subject: Add warning to generated files --- autoload/polyglot.vim | 4 ++-- ftdetect/polyglot.vim | 4 ++-- scripts/build | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/autoload/polyglot.vim b/autoload/polyglot.vim index ee03e989..d0e95b75 100644 --- a/autoload/polyglot.vim +++ b/autoload/polyglot.vim @@ -1,4 +1,4 @@ -""" autoload/polyglot.vim +" Please do not edit this file directly, instead modify polyglot.vim or scripts/build " Line continuation is used here, remove 'C' from 'cpoptions' let s:cpo_save = &cpo @@ -700,4 +700,4 @@ if exists('g:polyglot_disabled') endif " restore Vi compatibility settings -let &cpo = s:cpo_save +let &cpo = s:cpo_save \ No newline at end of file diff --git a/ftdetect/polyglot.vim b/ftdetect/polyglot.vim index cba8cf86..343d4528 100644 --- a/ftdetect/polyglot.vim +++ b/ftdetect/polyglot.vim @@ -1,4 +1,4 @@ -""" ftdetect/polyglot.vim +" Please do not edit this file directly, instead modify polyglot.vim or scripts/build " don't spam the user when Vim is started in Vi compatibility mode let s:cpo_save = &cpo @@ -2224,4 +2224,4 @@ if exists('g:polyglot_disabled') endif " restore Vi compatibility settings -let &cpo = s:cpo_save +let &cpo = s:cpo_save \ No newline at end of file diff --git a/scripts/build b/scripts/build index 0ed76045..482ffcf6 100755 --- a/scripts/build +++ b/scripts/build @@ -13,7 +13,8 @@ Dir.chdir(File.dirname(__dir__)) BASE_URL = 'https://raw.githubusercontent.com/github/linguist/master' def read_section(name) - File.read('polyglot.vim').match(/""" #{Regexp.escape(name)}.*\n(?=\n""")/m)[0] + "\" Please do not edit this file directly, instead modify polyglot.vim or scripts/build\n\n" + + File.read('polyglot.vim').match(/""" #{Regexp.escape(name)}\n*(.*)\n(?=\n""")/m)[1] end def camelize(str) -- cgit v1.2.3