Skip to content

feat(icons): use virtual text if possible#255

Merged
justinmk merged 1 commit into
justinmk:masterfrom
brianhuster:master
Feb 6, 2025
Merged

feat(icons): use virtual text if possible#255
justinmk merged 1 commit into
justinmk:masterfrom
brianhuster:master

Conversation

@brianhuster

@brianhuster brianhuster commented Feb 6, 2025

Copy link
Copy Markdown
Contributor

Closes #145, #253

Screenshot of vim-dirvish with Nerdfont icon
image

Regarding #253, I don't see the bug when using virtual text (both extmark and textprop) instead of conceal for icons, so it's possibly a bug with icons. That's why I think PR can also close that issue

@brianhuster brianhuster force-pushed the master branch 2 times, most recently from fc6b544 to b9f240c Compare February 6, 2025 15:24
@brianhuster

Copy link
Copy Markdown
Contributor Author

@justinmk Icon providers like mini.icons also returns highlight group for icon. Also, both extmark and textprop supports highlight group for virtual text (though the API of textprop seems trickier), I would also like to allow the callback param of add_icon_fn to be able to return a dictionary that includes 2 field : text and highlight.

@justinmk justinmk left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nicely done! I'll go ahead and merge this since it's low-risk.

@justinmk justinmk merged commit 5d1d1ef into justinmk:master Feb 6, 2025
Comment thread autoload/dirvish.vim
return
endif
highlight clear Conceal
let l:feat = has('nvim-0.8') ? 'extmark' : ((v:version >= 901 && has('textprop'))? 'textprop': 'conceal')

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably be a script-level var.

@justinmk

justinmk commented Feb 6, 2025

Copy link
Copy Markdown
Owner

I would also like to allow the callback param of add_icon_fn to be able to return a dictionary that includes 2 field : text and highlight.

Ok.

brianhuster added a commit to brianhuster/vim-dirvish that referenced this pull request Feb 6, 2025
feat(icons): use virtual text if possible justinmk#255
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

more than one character as an icon

2 participants