refactor: Prefer single quoted strings

This commit is contained in:
Caleb Maclennan
2023-02-21 16:11:54 +03:00
parent 425bdc51fd
commit 8e6d5f7afd
2 changed files with 4 additions and 4 deletions

View File

@@ -191,7 +191,7 @@ function! indent_guides#init_script_vars() abort
let s:hi_normal = indent_guides#capture_highlight('Normal') let s:hi_normal = indent_guides#capture_highlight('Normal')
" remove 'font=<value>' from the s:hi_normal string (only seems to happen on Vim startup in Windows) " remove 'font=<value>' from the s:hi_normal string (only seems to happen on Vim startup in Windows)
let s:hi_normal = substitute(s:hi_normal, ' font=[A-Za-z0-9:]\+', "", "") let s:hi_normal = substitute(s:hi_normal, ' font=[A-Za-z0-9:]\+', '', '')
" shortcuts to the global variables - this makes the code easier to read " shortcuts to the global variables - this makes the code easier to read
let s:debug = g:indent_guides_debug let s:debug = g:indent_guides_debug
@@ -247,10 +247,10 @@ endfunction
" "
function! indent_guides#capture_highlight(group_name) abort function! indent_guides#capture_highlight(group_name) abort
redir => l:output redir => l:output
exe "silent hi " . a:group_name exe 'silent hi ' . a:group_name
redir END redir END
let l:output = substitute(l:output, "\n", "", "") let l:output = substitute(l:output, '\n', '', '')
return l:output return l:output
endfunction endfunction

View File

@@ -35,7 +35,7 @@ command! -bar IndentGuidesDisable call s:IndentGuidesDisable()
" "
function s:InitVariable(var, value) function s:InitVariable(var, value)
if !exists(a:var) if !exists(a:var)
if type(a:value) == type("") if type(a:value) == type('')
exec 'let ' . a:var . ' = ' . "'" . a:value . "'" exec 'let ' . a:var . ' = ' . "'" . a:value . "'"
else else
exec 'let ' . a:var . ' = ' . a:value exec 'let ' . a:var . ' = ' . a:value