From f405cd51f7ab3b569c1f4ce43797cd64ccbe88d1 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 25 May 2019 17:19:03 +1200 Subject: Use get() in lieu of verbose pre-7.0 exists() --- autoload/big_file_options.vim | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'autoload') diff --git a/autoload/big_file_options.vim b/autoload/big_file_options.vim index 5c57343..f8b0671 100644 --- a/autoload/big_file_options.vim +++ b/autoload/big_file_options.vim @@ -1,8 +1,6 @@ " Wrapper function to get the configured size limit, default to 10 MiB function! s:Limit() - let limit = exists('g:big_file_options_limit') - \ ? g:big_file_options_limit - \ : 10 * 1024 * 1024 + let limit = get(g:, 'big_file_options_limit', 10 * 1024 * 1024) return limit endfunction @@ -67,9 +65,7 @@ function! s:SetPre() endif " Decide whether to set readonly options - let readonly = exists('g:big_file_options_readonly') - \ ? g:big_file_options_readonly - \ : 1 + let readonly = get(g:, 'big_file_options_readonly', 1) if readonly setlocal buftype=nowrite setlocal nomodifiable @@ -87,18 +83,14 @@ function! s:SetPost() if has('syntax') " Disable syntax highlighting if configured - let syntax = exists('g:big_file_options_syntax') - \ ? g:big_file_options_syntax - \ : 0 + let syntax = get(g:, 'big_file_options_syntax', 0) if !syntax setlocal syntax=OFF endif " Force maximum syntax columns down if configured if exists('+synmaxcol') - let synmaxcol = exists('g:big_file_options_synmaxcol') - \ ? g:big_file_options_synmaxcol - \ : 256 + let synmaxcol = get(g:, 'big_file_options_synmaxcol', 256) if exists('+synmaxcol') && &synmaxcol > synmaxcol let &l:synmaxcol = synmaxcol endif -- cgit v1.2.3