icyphox / nicy

:snowflake: a nice and icy zsh and bash prompt in Nim
https://icyphox.github.io/nicy/
MIT License
180 stars 8 forks source link

Code style changes, hostname bugfix, more types #13

Closed ghost closed 4 years ago

ghost commented 4 years ago

No major changes, but: Changed code style a bit. {.inline.} is really useless in our case anyway, it's not gonna change the performance when all we do is a prompt (just compile with -d:danger and your code is already very fast).

Changed colors to use an enum instead of strings which is better and less error-prone.

Fixed hostname - previously it was returning the error status of the gethostname() POSIX function, not the hostname itself.

icyphox commented 4 years ago

Thank you. What's funny is, most of the changes you've critiqued have been patches submitted by others -- because they think that's the right way! :P Good call on the enum though -- so much cleaner.

Merging now.

ghost commented 4 years ago

@icyphox well I know that @juancarlospaco sometimes adds some premature optimizations, but they're really not needed most of the time :) Especially that OpenMP loop