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
feat: show "fallback" in prompt title if, er, falling back
As discussed here:
- #393 (comment)
That comment suggested being a bit more verbose:
CommandT [ find (fall-backed from git) ]
but here I'm going with something a little less descriptive:
CommandT [fallback]
seeing as the extra detail in the title doesn't tell you _what_ went
wrong; really, all we can do here is show a hint that _something_ went
wrong, so we might as well be brief about it.
Two things to note about implementation:
- One is that I am playing around here trying to figure out how much
metatable magic I want in here without making it all too "clever". So
here I have a `__newindex` implementation that allows us to write
`prompt.name = 'fallback'` instead of `prompt:set_name('fallback')`.
The former is visually cleaner, but I don't necessarily like that it
hides the fact that an imperative side-effect is going to take place.
I will probably "dumb this down" as opposed to trying to use the
pattern in other places in a uniform way.
- The other is that my earlier claims about top-down React-style
dataflow are pretty much not true any more. It _was_ true at the
start, when each component rendered using data passed into it; now we
have muddied the waters considerably with imperative methods. I will
almost certainly want to revisit this topic in the future.
0 commit comments