aboutsummaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2019-05-25 17:22:28 +1200
committerTom Ryder <tom@sanctum.geek.nz>2019-05-25 17:22:28 +1200
commit1c9df5c45f9d90f62c5364bf6c21ba547a70cbd0 (patch)
tree2cf83f8749df5236e0333c86f69c1faf905456e6 /autoload
parentReorder functions; put interfaces on the top (diff)
downloadvim-big-file-options-1c9df5c45f9d90f62c5364bf6c21ba547a70cbd0.tar.gz
vim-big-file-options-1c9df5c45f9d90f62c5364bf6c21ba547a70cbd0.zip
Add "abort" attribute to functions
Diffstat (limited to 'autoload')
-rw-r--r--autoload/big_file_options.vim14
1 files changed, 7 insertions, 7 deletions
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