|
4 | 4 | let g:loaded_dirvish_git = 1
|
5 | 5 |
|
6 | 6 | let g:dirvish_git_show_ignored = get(g:, 'dirvish_git_show_ignored', 0)
|
| 7 | +let g:dirvish_git_show_icons = get(g:, 'dirvish_git_show_icons', 1) |
7 | 8 |
|
8 | 9 | if !exists('g:dirvish_git_indicators')
|
9 | 10 | let g:dirvish_git_indicators = {
|
@@ -147,9 +148,15 @@ function! s:highlight_file(dir, file_name, us, them, is_directory) abort
|
147 | 148 | let l:dir_rgx = escape(printf('%s\(%s%s\)\@=', a:dir, s:sep, a:file_name), s:escape_chars)
|
148 | 149 | let l:slash_rgx = escape(printf('\(%s\)\@<=%s\(%s\)\@=', a:dir, s:sep, a:file_name), s:escape_chars)
|
149 | 150 |
|
150 |
| - silent exe 'syn match DirvishGitDir "'.l:dir_rgx.'" conceal cchar='.s:get_indicator(a:us, a:them) |
| 151 | + " Check if icons should be shown |
| 152 | + let l:conceal_char = g:dirvish_git_show_icons |
| 153 | + \ ? ' cchar=' .. s:get_indicator(a:us, a:them) |
| 154 | + \ : '' |
| 155 | + let l:conceal_last_folder_char = g:dirvish_git_show_icons ? ' cchar= ' : '' |
| 156 | + |
| 157 | + silent exe 'syn match DirvishGitDir "'.l:dir_rgx.'" conceal' .. l:conceal_char |
151 | 158 | silent exe 'syn match '.s:get_highlight_group(a:us, a:them, a:is_directory).' "'.l:file_rgx.'" contains=DirvishGitSlash'
|
152 |
| - silent exe 'syn match DirvishGitSlash "'.l:slash_rgx.'" conceal cchar= contained' |
| 159 | + silent exe 'syn match DirvishGitSlash "'.l:slash_rgx.'" conceal contained' .. l:conceal_last_folder_char |
153 | 160 | endfunction
|
154 | 161 |
|
155 | 162 | function! s:setup_highlighting() abort
|
|
0 commit comments