spaceship.zsh#L112
runs before user customizations are applied to SPACESHIP_PROMPT_ORDER and SPACESHIP_RPROMPT_ORDER.
Instead of sourcing the contents of these arrays, it would be safer to source everything in /sections. There'd be no change to what's sourced, and the union call would be removed.
Ideally only things in the final arrays would be sourced. If there's some way to ask "is this the initial load?" and move the sourcing downstream (looks like maybe it has to be in spaceship_prompt()?) that'd be nice. But this might be #wontfix — I've been playing with it, and can't find a good way to do it.
Just make sure your SPACESHIP_PROMPT_ORDER is defined before spaceship-prompt is being sourced, and your user customizations will be applied. I'm using this approach, it works.
I see that does work.
The documentation states firmly that customizations should go after the theme, so I'm surprised nothing breaks.
The documentation is easy enough to edit, but if there are any future changes where this matters I'm not sure users could be expected to say "I wonder if they flipped that rule?"
Huh, nicely spotted, I've actually never noticed this part of the documentation and discovered myself by trial and error 🙂
Most helpful comment
Huh, nicely spotted, I've actually never noticed this part of the documentation and discovered myself by trial and error 🙂