You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What version of vim are you using? Vi IMproved 8.0 (2016 Sep 12, compiled Mar 17 2017 12:13:35)
What version of vim-devicons are you using? 0.9.0
Are you using vim from the terminal or a GUI vim? Terminal
Are you using Mac, Linux or Windows? Linux
Bug
vim-airline has the feature to hide the expected file format and encoding (g:airline#parts#ffenc#skip_expected_string). This is very useful, since I'm only really interesting in the file format/encoding if it's NOT utf-8+unix. Using vim-devicons "breaks" this feature (the function checking the value is not called anymore or its return value is ignored?).
Would be nice to a) check the value of g:airline#parts#ffenc#skip_expected_string or b) implement something equivalent in vim-devicons.
Don't use a tabline, maybe changes in the file you linked are necessary as well (also I never wrote vimscript, there are probably nicer ways to do this).
That would disable the replacement text to icon. I do really like the icons, but I only need the information for file format and encoding if it's not what I am expecting. To see "utf-8[unix]" (or "utf-8 ") for all my files is unnecessary information (like git status would show me all files that have not changed). But I wouldn't mind "utf-8 " or "latin-1 ", since that might indicate an error.
So with your suggested change and not disabling the glyphs for fileencoding it does seem to be working as expected.
I have been testing with setting fileenconding via command mode and it does work but doesn't update until AirlineRefresh is called. This shouldn't be a big issue as most likely you aren't going to be switching back and forth filetypes?
Great! Thanks for verifying. Also thanks for the report. ❤️
By the way, I usually ask if someone makes an unofficial code fix if they would like to submit a PR but I just assumed you didn't want/care to do that 😛 but let me know if otherwise 😊
@ryanoasis yeah, I know the joy of stumbling upon an easy/fast to fix problem 😉
It's a nice book, being in small and easy to grok chunks makes it far more attractive to read than a lot of other tech literature (also you can sound a lot smarter by inserting those ideas now and then 😜)
And I guess most people would agree with this rule. If you have to touch the code, at least don't make it worse (and not knowing a language makes it quite hard to even know if you make it better/worse).
Activity
ryanoasis commentedon May 2, 2017
@x4121 Hey thanks for the report! 😄 Good catch.
So right now this plugin tacks that part on (and it's not even configurable 😢): https://github.com/ryanoasis/vim-devicons/blob/master/autoload/airline/extensions/tabline/formatters/webdevicons.vim#L9
Should be an easy fix.
In the meantime you can hack that line to remove it or disable VimDevIcons plugin altogether 😊
x4121 commentedon May 3, 2017
Why write it configurable if you don't know of the feature in the first place 🙂
Thanks for the plugin btw 👍
ryanoasis commentedon May 6, 2017
Thanks for the kind words.
Yeah that's a good point. I guess I feel like there should have been foresight but maybe that's wishful thinking 😆
x4121 commentedon May 6, 2017
Changing https://github.com/ryanoasis/vim-devicons/blob/master/plugin/webdevicons.vim#L685 from
if g:webdevicons_enable_airline_statusline_fileformat_symbolstoif g:webdevicons_enable_airline_statusline_fileformat_symbols && airline#parts#ffenc() != ''would fix it for me. 🙂Don't use a tabline, maybe changes in the file you linked are necessary as well (also I never wrote vimscript, there are probably nicer ways to do this).
ryanoasis commentedon May 7, 2017
@x4121 Thanks.. what timing.. I am actually working on this right now 😄
x4121 commentedon May 7, 2017
Haha.. sorry, didn't want to disturb/nag you there 😂
But nice to hear that 🙂
ryanoasis commentedon May 7, 2017
@x4121 Oh yeah no worries 😄
Honestly I completely forgot about the
g:webdevicons_enable_airline_statusline_fileformat_symbolsoption!Does disabling it not do what you expect:
You are wanting to not show any encoding right?
Doesn't setting this accomplish that:
Or am I missing something? 😊
ryanoasis commentedon May 7, 2017
Nevertheless your suggested change is a good defensive check and doesn't break anything. I will add it soon
x4121 commentedon May 7, 2017
That would disable the replacement text to icon. I do really like the icons, but I only need the information for file format and encoding if it's not what I am expecting. To see "utf-8[unix]" (or "utf-8 ") for all my files is unnecessary information (like git status would show me all files that have not changed). But I wouldn't mind "utf-8 " or "latin-1 ", since that might indicate an error.
ryanoasis commentedon May 7, 2017
@x4121 Ah okay I understand now.
So with your suggested change and not disabling the glyphs for fileencoding it does seem to be working as expected.
I have been testing with setting fileenconding via command mode and it does work but doesn't update until AirlineRefresh is called. This shouldn't be a big issue as most likely you aren't going to be switching back and forth filetypes?
vimrc settings:
Adds defensive logic for airline fileformat encoding part (ref #203)
ryanoasis commentedon May 7, 2017
I am going to release this in a few hours 📦 , if you would like to help test the
0.9.1branch is up. Thanksx4121 commentedon May 7, 2017
Already checked, works like a charm 🙂
ryanoasis commentedon May 7, 2017
Great! Thanks for verifying. Also thanks for the report. ❤️
By the way, I usually ask if someone makes an unofficial code fix if they would like to submit a PR but I just assumed you didn't want/care to do that 😛 but let me know if otherwise 😊
x4121 commentedon May 7, 2017
Thanks for fixing it that fast 😃
After reporting I was thinking about writing one... but I can barely read vimscript and feared I couldn't comply with the boy scout rule 😉
ryanoasis commentedon May 7, 2017
@x4121 Sure no problem. I wish some of the other issues were as fast 😊
Interesting link I honestly haven't read that before, so thanks for that too.
x4121 commentedon May 7, 2017
@ryanoasis yeah, I know the joy of stumbling upon an easy/fast to fix problem 😉
It's a nice book, being in small and easy to grok chunks makes it far more attractive to read than a lot of other tech literature (also you can sound a lot smarter by inserting those ideas now and then 😜)
And I guess most people would agree with this rule. If you have to touch the code, at least don't make it worse (and not knowing a language makes it quite hard to even know if you make it better/worse).