:feature: show submode in status bar#574
Conversation
There was a problem hiding this comment.
I like it; nice solution. Nitpicks:
- I'd rather use
.as the delimiter than$. It would just mean we'd have to quote the keys. - I think you could avoid depending on the order of
ContentsByModeif you did this:
currentMode = currentMode + "." + currentSubmode if currentSubmode?
for mode, [klass, html] of ContentsByMode
if mode is currentMode
# ... There was a problem hiding this comment.
Thank you.
I've committed a fix in 91069db so the code doesn't rely on order, keeping the ability to match only on the mode. If we don't keep currentFullMode we'd have to enumerate all submodes in ContentsByMode.
Which alternative would you prefer?
There was a problem hiding this comment.
Oh, I see what you're saying. I think the most straightforward thing to do is to use the code snippet I wrote above; we just need to enumerate all possible combinations of mode and submode in ContentsByMode, rather than abbreviating visual.characterwise as visual.
I don't think we can use a break statement like you have on line 30, because it could incorrectly prevent classes from being removed from the @element div.
There was a problem hiding this comment.
You're right, I missed that. OK, enumeration it is; the longer I've thought about it the better this option has sounded anyway. Commit coming soon.
91069db to
0098383
Compare
the previous version could leave the wrong classes on the status bar div
|
And I still can't get it as simple as you suggested, @maxbrunsfeld : |
:feature: show submode in status bar
|
Thanks! 8-) |
:feature: show submode in status bar
This is a suggestion that we may want to show the submode in the status bar; the PR already includes values for replace mode, proposed in #573.