Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tex icon affects filename #204

Closed
mrossinek opened this issue Nov 11, 2020 · 7 comments
Closed

Tex icon affects filename #204

mrossinek opened this issue Nov 11, 2020 · 7 comments

Comments

@mrossinek
Copy link

I was unsure whether to file this issue here or at https://github.com/kyazdani42/nvim-web-devicons so I am going to tag @kyazdani42

Today I noticed the following bug:
screenshot_1605115011
On the left you can see a dirvish buffer of the contents as listed on the right.

On line 6 you can see that the filename of the tex file is printed in reverse! I have no idea what could cause this but without the devicons it obviously does not happend.

I use this to display the icons:

call dirvish#add_icon_fn({p -> luaeval("require('nvim-web-devicons').get_icon(vim.fn.fnamemodify('" .. p .. "', ':e')) or ' '")})
@kyazdani42
Copy link

well i don't think this should be related to icons. Could you reproduce with a super minimal vimrc ? like only dirvish and web devicons ?

@mrossinek
Copy link
Author

mrossinek commented Nov 12, 2020

On my system, starting nvim -u NONE and then sourcing the following file, seems to do the trick at reproducing the issue:

packadd vim-dirvish
packadd nvim-web-devicons
call dirvish#add_icon_fn({p -> luaeval("require('nvim-web-devicons').get_icon(vim.fn.fnamemodify('" .. p .. "', ':e')) or ' '")})

Here is the output of :scriptnames after running the above and calling :e .:

  1: ~/tmp/init.vim   <- this is the file above
  2: ~/dotfiles/nvim/.config/nvim/pack/minpac/start/vim-dirvish/plugin/dirvish.vim
  3: ~/dotfiles/nvim/.config/nvim/pack/minpac/start/nvim-web-devicons/plugin/nvim-web-devicons.vim
  4: ~/dotfiles/nvim/.config/nvim/pack/minpac/start/vim-dirvish/autoload/dirvish.vim
  5: ~/dotfiles/nvim/.config/nvim/pack/minpac/start/vim-dirvish/ftplugin/dirvish.vim

@kyazdani42
Copy link

I don't think this issue can come from nvim-web-devicons, which only returns an icon and a highlight group. It doesn't operator on text. Dirvish must do something weird with the result.

@kyazdani42
Copy link

:lua print(require'nvim-web-devicons'.get_icon('tex')..' test.tex') doesn't produce any weird stuff. This issue is dirvish related imo.

@mrossinek
Copy link
Author

:lua print(require'nvim-web-devicons'.get_icon('tex')..' test.tex') doesn't produce any weird stuff. This issue is dirvish related imo.

Actually, I observe the same strange behavior when not placing the space between the icon and the text. I.e.:

lua print(require('nvim-web-devicons').get_icon('tex')..'test.tex')

Gives: xet.tsetﭨ

PS: Sorry for the long delay, I only just found time to look into this again.

@mrossinek
Copy link
Author

mrossinek commented Feb 24, 2021

Try for example opening the following file:

Text before TeX character:
test ﭨ

Text after TeX character (with a separating space):
ﭨ test

Text after TeX character (withOUT a separating space):
ﭨtest

Here is a screenshot of the results:
screenshot_1614188843

The editors are:

  • Top left: nvim test.tex
  • Bottom left: nvim --noplugin --clean test.tex
  • Top right: \vim test.tex
  • Bottom right: \vim --noplugin --clean test.tex

System: Linux 5.10.16-arch1-1
Neovim: NVIM v0.5.0-dev+1094-gd623400ca
Vim: VIM - Vi IMproved 8.2; Included patches: 1-2489

@mrossinek
Copy link
Author

The issue does not appear in alacritty so I am starting to believe it lies with kitty. I will close this here and take my issue there..

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

No branches or pull requests

2 participants