Skip to content

Commit 63554a3

Browse files
committed
Use robust operators ==# or ==? instead of ==
1 parent 8e6d5f7 commit 63554a3

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

autoload/indent_guides.vim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ endfunction
106106
" gVim when colors can't be automatically calculated.
107107
"
108108
function! indent_guides#basic_highlight_colors() abort
109-
let l:cterm_colors = (&g:background == 'dark') ? ['darkgrey', 'black'] : ['lightgrey', 'white']
110-
let l:gui_colors = (&g:background == 'dark') ? ['grey15', 'grey30'] : ['grey70', 'grey85']
109+
let l:cterm_colors = (&g:background ==# 'dark') ? ['darkgrey', 'black'] : ['lightgrey', 'white']
110+
let l:gui_colors = (&g:background ==# 'dark') ? ['grey15', 'grey30'] : ['grey70', 'grey85']
111111

112112
exe 'hi IndentGuidesEven guibg=' . l:gui_colors[0] . ' guifg=' . l:gui_colors[1] . ' ctermbg=' . l:cterm_colors[0] . ' ctermfg=' . l:cterm_colors[1]
113113
exe 'hi IndentGuidesOdd guibg=' . l:gui_colors[1] . ' guifg=' . l:gui_colors[0] . ' ctermbg=' . l:cterm_colors[1] . ' ctermfg=' . l:cterm_colors[0]
@@ -153,7 +153,7 @@ endfunction
153153
function! indent_guides#lighten_or_darken_color(color) abort
154154
let l:new_color = ''
155155

156-
if (&g:background == 'dark')
156+
if (&g:background ==# 'dark')
157157
let l:new_color = color_helper#hex_color_lighten(a:color, s:change_percent)
158158
else
159159
let l:new_color = color_helper#hex_color_darken (a:color, s:change_percent)

plugin/indent_guides.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ if !exists('g:indent_guides_exclude_filetypes')
6767
endif
6868

6969
" Default mapping
70-
if !hasmapto('<Plug>IndentGuidesToggle', 'n') && maparg('<Leader>ig', 'n') == ''
70+
if !hasmapto('<Plug>IndentGuidesToggle', 'n') && maparg('<Leader>ig', 'n') ==# ''
7171
\ && g:indent_guides_default_mapping != 0
7272
nmap <silent><unique> <Leader>ig <Plug>IndentGuidesToggle
7373
endif

0 commit comments

Comments
 (0)