Skip to content

Commit

Permalink
Fix funced handling and funced emulation.
Browse files Browse the repository at this point in the history
The wrong autocommand was changed in 0dfeda7.

Also use BufNewFile instead of BufRead.
  • Loading branch information
blank_name committed Feb 8, 2020
1 parent 8c034e8 commit fc758c6
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions plugin/fish.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit fc758c6

Please sign in to comment.