Commit c16b272
committed
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.1 parent a699dc9 commit c16b272
File tree
4 files changed
+36
-5
lines changed- lua/wincent/commandt/private
- finders
4 files changed
+36
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
10 | 10 | | |
11 | 11 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
13 | 20 | | |
14 | 21 | | |
15 | 22 | | |
| |||
47 | 54 | | |
48 | 55 | | |
49 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
50 | 68 | | |
51 | 69 | | |
52 | 70 | | |
| |||
64 | 82 | | |
65 | 83 | | |
66 | 84 | | |
67 | | - | |
68 | 85 | | |
69 | 86 | | |
70 | 87 | | |
| |||
79 | 96 | | |
80 | 97 | | |
81 | 98 | | |
82 | | - | |
| 99 | + | |
83 | 100 | | |
84 | 101 | | |
85 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
99 | 99 | | |
100 | 100 | | |
101 | 101 | | |
102 | | - | |
| 102 | + | |
| 103 | + | |
103 | 104 | | |
104 | 105 | | |
105 | 106 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
198 | 198 | | |
199 | 199 | | |
200 | 200 | | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
201 | 214 | | |
202 | 215 | | |
203 | 216 | | |
| |||
407 | 420 | | |
408 | 421 | | |
409 | 422 | | |
410 | | - | |
| 423 | + | |
411 | 424 | | |
412 | 425 | | |
413 | 426 | | |
| |||
0 commit comments