Closed get-me-power closed 4 years ago
Thank you for the contribution! Adding icon to each item looks nice, but there are some points that I'm concerned about.
I think a file icon and its name should be placed side by side because they express the same subject.
(file icon) (selection mark) (file name)
(selection mark) (file icon) (file name)
Current implementation is tightly coupled with vim-devicons. If user want to use another way to show icon, we should add another renderer option and related fixes to Vaffle. I think that providing a custom function to render icon is better solution. For example:
function! RenderMyFavoriteIcon(item)
" Use vim-devicons or other favorite way
return ...
endfunction
let g:vaffle_render_custom_icon = 'RenderMyFavoriteIcon'
@cocopon Thanks for review! How about this patch?
function! RenderMyFavoriteIcon(item)
return printf('%s %s %s',
\ a:item.selected ? '*' : ' ',
\ WebDevIconsGetFileTypeSymbol(a:item.basename, a:item.is_dir),
\ a:item.basename . (a:item.is_dir ? '/' : ''))
endfunction
let g:vaffle_render_custom_icon = 'RenderMyFavoriteIcon'
If you writing this config in vimrc, vaffle can render icon font.
Thanks!
'default'
looks like a function nameI adjusted. How about this?
function! RenderMyFavoriteIcon(item)
return WebDevIconsGetFileTypeSymbol(a:item.basename, a:item.is_dir)
endfunction
let g:vaffle_render_custom_icon = 'RenderMyFavoriteIcon'
Looks good! Looking into the details...
In addition, I changed the syntax highlighting. I think it will render correctly.
I updated document and syntax name.
@cocopon Thanks for review, I fixed.
Great! Finally, could you squash all commits into a single one and force-push it? I'll merge it.
OK, I squashed!
@cocopon Sorry.., I fixed.
Merged. Thank you for your contribution!
Thank you for your kind review and merge.
Hello, @cocopon . Thanks for creating great Vim plugin. I wrote a patch to support vim-devicons.
vim-devicons url
This patch can rendering icon font. Could you check this PR?
screen shot