vimium
vimium copied to clipboard
unify initing processes of modes
There's a bug that some new
-ed modes are never inited, imported when migrating from CoffeeScript to ES6. This PR fixes this by forcing subclasses of Mode
to call super.init()
in their constructors.
This fixes #3865, fixes #3866, fixes #3926, fixes #4062 and replaces #3877.
Hey, what is needed to get this merged?
@gdh1995 nice job finding the regression. I want to look at this more carefully, so I didn't bundle it with the release for #3985.
It's OKay. Then I wish Vimium can merge #4064 to fix V
and c
in VisualMode (~~#3877~~ has some unrelated commits, so #4064 seems better).
@philc bump. Carret mode needed
Bump.
Is there any reason a 1 year old pr that fixes a bug is not merged yet?
bump.
plz?
Alright folks, sorry for the delay. @gdh1995 checking in again to see what you think of this vs. #4064 (which is also now equivalent to #3877)?
The use of inheritance in the implementation of modes is unnecessarily complex and I'd like to greatly simplify it at some point. #4064 is a simpler patch (3 LOC change) because it doesn't introduce new constraints around using super. I think they both fix precisely the same set of bugs, correct?
Yes it worths to merge #4064.
Ok great -- closing this in favor of #3877.
BTW, I've reviewed Vimium's current code and noticed that:
- Vimium's sub-classes of
Mode
overrides eitherconstructor
orinit
, so it is indeed acceptable to keep this usage.