geometry-zsh / geometry

geometry is a minimal, fully customizable and composable zsh prompt theme
ISC License
921 stars 94 forks source link

Plugin ordering? #220

Closed pbar1 closed 4 years ago

pbar1 commented 5 years ago

Is it possible to order plugins? I made the custom plugin geometry-terraform to display the Terraform workspace of the current directory, and while it does work, the plugin placement is off:

image

This is the configuration I'm using in my zshrc, and I'd assume terraform would come first:

▲ ~ cat .zshrc | rg GEOMETRY
export GEOMETRY_PROMPT_PLUGINS=(terraform exec_time jobs node virtualenv kube git)

Versus this, the output I get from geometry_plugin_list; terraform is now at the end of the list, while the order of the rest of the plugins is still intact:

▲ ~ geometry_plugin_list
primary:
path hostname
secondary:
exec_time jobs node virtualenv kube git terraform

What can I do to ensure the ordering is correct?

(This theme is incredible btw! It makes my daily dev work smoother and more fun)

jedahan commented 5 years ago

Interesting issue. Just for giggles, can you try using GEOMETRY_PROMPT_PLUGINS_SECONDARY instead of GEOMETRY_PROMPT_PLUGINS and see if that fixes it?

pbar1 commented 5 years ago

Changing to GEOMETRY_PROMPT_PLUGINS_SECONDARY has the same effect. Looking at the code it looks like it might be because default plugins are registered all at once, and then third party ones are registered afterward?

jedahan commented 5 years ago

Looks like thats the issue. Unfortunately I won't have time to look at it for a few weeks. If anyone else wants to try and fix it I can do a code review though.

Otherwise feel free to ping in a couple of weeks

jedahan commented 5 years ago

If we merge #233 we will be able to close this

jedahan commented 4 years ago

fixed by v2