vimium icon indicating copy to clipboard operation
vimium copied to clipboard

unify initing processes of modes

Open gdh1995 opened this issue 2 years ago • 6 comments

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.

gdh1995 avatar Jul 18 '21 21:07 gdh1995

Hey, what is needed to get this merged?

primeapple avatar Nov 08 '21 08:11 primeapple

@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.

philc avatar Jan 20 '22 04:01 philc

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).

gdh1995 avatar Jan 20 '22 16:01 gdh1995

@philc bump. Carret mode needed

mrGrochowski avatar Jun 09 '22 09:06 mrGrochowski

Bump.

Is there any reason a 1 year old pr that fixes a bug is not merged yet?

Pytness avatar Aug 29 '22 09:08 Pytness

bump.

plz?

AndyJado avatar Sep 14 '22 11:09 AndyJado

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?

philc avatar Oct 17 '22 06:10 philc

Yes it worths to merge #4064.

gdh1995 avatar Oct 17 '22 06:10 gdh1995

Ok great -- closing this in favor of #3877.

philc avatar Oct 17 '22 06:10 philc

BTW, I've reviewed Vimium's current code and noticed that:

  • Vimium's sub-classes of Mode overrides either constructor or init, so it is indeed acceptable to keep this usage.

gdh1995 avatar Oct 17 '22 06:10 gdh1995