From fc758c6da7d73ccddc2120df451f97e2abf61c5c Mon Sep 17 00:00:00 2001 From: blank_name <> Date: Sat, 8 Feb 2020 11:46:11 -0500 Subject: [PATCH] Fix funced handling and funced emulation. The wrong autocommand was changed in 0dfeda7. Also use BufNewFile instead of BufRead. --- plugin/fish.vim | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/plugin/fish.vim b/plugin/fish.vim index 03b9184..5efe6c4 100644 --- a/plugin/fish.vim +++ b/plugin/fish.vim @@ -11,9 +11,9 @@ autocmd BufRead,BufNewFile ~/.config/fish/fishd.*,~/.config/fish/fish_variables " - Reindent (because funced adds a tab on the first empty line and the user may " have set expandtab). " - Move the cursor to the first empty line. -autocmd BufRead fish_funced.* - \ exe retab | call search('^\s*\zs$') +autocmd BufRead fish_funced.*,fish_funced_*_*.fish,/tmp/fish.*/*.fish + \ retab | call search('^\s*\zs$') " Mimic `funced` when manually creating functions. -autocmd BufRead fish_funced.*,fish_funced_*_*.fish,/tmp/fish.*/*.fish +autocmd BufNewFile ~/.config/fish/functions/*.fish \ call setline(1, ['function '.expand('%:t:r'), '', 'end']) | 2