From 1c9df5c45f9d90f62c5364bf6c21ba547a70cbd0 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 25 May 2019 17:22:28 +1200 Subject: Add "abort" attribute to functions --- autoload/big_file_options.vim | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'autoload') diff --git a/autoload/big_file_options.vim b/autoload/big_file_options.vim index e167dc2..0eca0be 100644 --- a/autoload/big_file_options.vim +++ b/autoload/big_file_options.vim @@ -1,5 +1,5 @@ " If we can use filesize to detect the big file early, we should -function! big_file_options#CheckPre(filename) +function! big_file_options#CheckPre(filename) abort " Try and get filesize, bail out if we can't let size = getfsize(a:filename) @@ -19,7 +19,7 @@ endfunction " If it's still indeterminate (stdin read?), try to check the buffer size " itself -function! big_file_options#CheckPost() +function! big_file_options#CheckPost() abort " The BufReadPre hook couldn't tell how big the file was; we'll examine it " now it's loaded into the buffer instead @@ -49,13 +49,13 @@ function! big_file_options#CheckPost() endfunction " Wrapper function to get the configured size limit, default to 10 MiB -function! s:Limit() +function! s:Limit() abort let limit = get(g:, 'big_file_options_limit', 10 * 1024 * 1024) return limit endfunction " These options can and should be set as early as possible -function! s:SetPre() +function! s:SetPre() abort " These are always set setlocal noswapfile @@ -74,7 +74,7 @@ function! s:SetPre() endfunction " These options need to be set later, after the buffer has loaded -function! s:SetPost() +function! s:SetPost() abort " Force filetype off setlocal filetype=NONE @@ -104,7 +104,7 @@ function! s:SetPost() endfunction " If we can use filesize to detect the big file early, we should -function! big_file_options#CheckPre(filename) +function! big_file_options#CheckPre(filename) abort " Try and get filesize, bail out if we can't let size = getfsize(a:filename) @@ -124,7 +124,7 @@ endfunction " If it's still indeterminate (stdin read?), try to check the buffer size " itself -function! big_file_options#CheckPost() +function! big_file_options#CheckPost() abort " The BufReadPre hook couldn't tell how big the file was; we'll examine it " now it's loaded into the buffer instead -- cgit v1.2.3