Use strwidth over strchars() for tabline width calc

This commit is contained in:
Danielle McLean 2023-10-31 12:05:39 +11:00
parent 3535540bdb
commit 7fd66a3e41
Signed by: 00dani
GPG key ID: 52C059C3B22A753E

View file

@ -100,7 +100,7 @@ def InitTab()
endif endif
const icon = bufname(bufnr)->g:nerdfont#find()->st.DropIfDefault(g:nerdfont#default)->st.PrependIfVisible(' ') const icon = bufname(bufnr)->g:nerdfont#find()->st.DropIfDefault(g:nerdfont#default)->st.PrependIfVisible(' ')
const iconWidth = strchars(icon) const iconWidth = strwidth(icon)
if width + iconWidth >= maxWidth if width + iconWidth >= maxWidth
return [tabDisplay, width] return [tabDisplay, width]
endif endif