aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2017-11-05 00:38:36 +1300
committerTom Ryder <tom@sanctum.geek.nz>2017-11-05 00:38:36 +1300
commit4cda78380362c7ca9d1c7a603a68a134fa2f98dc (patch)
tree32f04bbb40eb9e1dd6f4ac6d114db8ee99dbf30d
parentMerge branch 'feature/gvimrc-refa...' into develop (diff)
parentUse BufReadPost hook for big_file_options.vim (diff)
downloaddotfiles-4cda78380362c7ca9d1c7a603a68a134fa2f98dc.tar.gz
dotfiles-4cda78380362c7ca9d1c7a603a68a134fa2f98dc.zip
Merge branch 'feature/vim-bigfile...' into develop
* feature/vim-bigfile-fix: Use BufReadPost hook for big_file_options.vim
-rw-r--r--vim/plugin/big_file_options.vim8
1 files changed, 4 insertions, 4 deletions
diff --git a/vim/plugin/big_file_options.vim b/vim/plugin/big_file_options.vim
index 3d239048..bbbedc96 100644
--- a/vim/plugin/big_file_options.vim
+++ b/vim/plugin/big_file_options.vim
@@ -30,8 +30,8 @@ endif
" Declare function for turning off slow options
function! s:BigFileOptions()
- " Don't do anything if the file is under the threshold
- if getfsize(expand('<afile>')) <= g:big_file_size
+ " Don't do anything if the buffer size is under the threshold
+ if line2byte(line('$') + 1) <= g:big_file_size
return
endif
@@ -57,9 +57,9 @@ function! s:BigFileOptions()
endfunction
" Define autocmd for calling to check filesize
-augroup big_file_options_bufreadpre
+augroup big_file_options_bufreadpost
autocmd!
- autocmd BufReadPre
+ autocmd BufReadPost
\ *
\ call s:BigFileOptions()
augroup end