From 95a52e3ce45ddc5fd9d1a93d5d076896787840c0 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 29 May 2019 02:33:26 +1200 Subject: Remove unneeded function name --- plugin/shebang_change_filetype.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugin/shebang_change_filetype.vim') diff --git a/plugin/shebang_change_filetype.vim b/plugin/shebang_change_filetype.vim index ca6c183..69a4ad5 100644 --- a/plugin/shebang_change_filetype.vim +++ b/plugin/shebang_change_filetype.vim @@ -17,9 +17,9 @@ let loaded_shebang_change_filetype = 1 augroup shebang_change_filetype autocmd! autocmd InsertLeave * - \ call shebang_change_filetype#Check() + \ call shebang_change_filetype#() if exists('##TextChanged') autocmd TextChanged * - \ call shebang_change_filetype#Check() + \ call shebang_change_filetype#() endif augroup END -- cgit v1.2.3 From e667db41ebc868c63a735cc1e9711c10c3c2f321 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 29 May 2019 02:34:09 +1200 Subject: Condense load guard --- plugin/shebang_change_filetype.vim | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'plugin/shebang_change_filetype.vim') diff --git a/plugin/shebang_change_filetype.vim b/plugin/shebang_change_filetype.vim index 69a4ad5..0bb1e51 100644 --- a/plugin/shebang_change_filetype.vim +++ b/plugin/shebang_change_filetype.vim @@ -5,10 +5,7 @@ " Author: Tom Ryder " License: Same as Vim itself " -if exists('loaded_shebang_change_filetype') || &compatible - finish -endif -if !has('autocmd') || v:version < 700 +if exists('loaded_shebang_change_filetype') || &compatible || v:version < 700 finish endif let loaded_shebang_change_filetype = 1 -- cgit v1.2.3 From b4cd4708ff269f13330b8643d6e2a4902e7e4cb9 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 29 May 2019 02:34:22 +1200 Subject: Correct indenting --- plugin/shebang_change_filetype.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugin/shebang_change_filetype.vim') diff --git a/plugin/shebang_change_filetype.vim b/plugin/shebang_change_filetype.vim index 0bb1e51..a5f1ca7 100644 --- a/plugin/shebang_change_filetype.vim +++ b/plugin/shebang_change_filetype.vim @@ -14,7 +14,7 @@ let loaded_shebang_change_filetype = 1 augroup shebang_change_filetype autocmd! autocmd InsertLeave * - \ call shebang_change_filetype#() + \ call shebang_change_filetype#() if exists('##TextChanged') autocmd TextChanged * \ call shebang_change_filetype#() -- cgit v1.2.3 From eb2f8b55288d240aa40e6a08ac2e8cac4a272142 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 29 May 2019 02:34:31 +1200 Subject: Use :doautocmd to avoid redundancy --- plugin/shebang_change_filetype.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plugin/shebang_change_filetype.vim') diff --git a/plugin/shebang_change_filetype.vim b/plugin/shebang_change_filetype.vim index a5f1ca7..a27cb70 100644 --- a/plugin/shebang_change_filetype.vim +++ b/plugin/shebang_change_filetype.vim @@ -17,6 +17,6 @@ augroup shebang_change_filetype \ call shebang_change_filetype#() if exists('##TextChanged') autocmd TextChanged * - \ call shebang_change_filetype#() + \ doautocmd InsertLeave endif augroup END -- cgit v1.2.3 From 6d82af8c6daf73e5026b50d3e132adc217c2bf61 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Wed, 29 May 2019 02:36:58 +1200 Subject: Condense and solidify documentation --- plugin/shebang_change_filetype.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugin/shebang_change_filetype.vim') diff --git a/plugin/shebang_change_filetype.vim b/plugin/shebang_change_filetype.vim index a27cb70..03f5830 100644 --- a/plugin/shebang_change_filetype.vim +++ b/plugin/shebang_change_filetype.vim @@ -1,6 +1,6 @@ " -" shebang_change_filetype.vim: On leaving insert mode, check whether the first -" line was changed and looks like a shebang format. +" shebang_change_filetype.vim: Re-run filetype detection if a shebang #! is +" added or changed in the buffer. " " Author: Tom Ryder " License: Same as Vim itself -- cgit v1.2.3