tamton-aquib / staline.nvim

A modern lightweight statusline and bufferline plugin for neovim in lua.
MIT License
373 stars 16 forks source link

Fixed bug w/ MacOS detection #6

Closed is0n closed 3 years ago

is0n commented 3 years ago

Problem

The status line brings up the Linux icon as the "cool_symbol" despite being on MacOS (or BSD).

Solution

Checking if the user is using MacOS before checking if the user is using a unix-like operating system.

Explanation

Since MacOS is technically a unix-like operating system, it's detected as such and since all unix-like operating systems are grouped up into being Linux distros, MacOS users will find the Linux icon as their "cool_symbol" instead of the Apple logo.

To avoid this, we need to check if the user's operating system is MacOS before checking if it's a unix-like operating system as doing this prevents the program from detecting MacOS as Linux.

Extra Notes

I plan on adding support for BSD and specific Linux distros (by specific I mean checking what Linux distro the user is using and then displaying the logo of that distro) as writing off all unix-like operating systems as just Linux isn't ideal (for me at least.)

tamton-aquib commented 3 years ago

Heyyo @is0n , Good catch and a perfect explanation.

And thank you very much for your contribution. 😅