vue-codemirror icon indicating copy to clipboard operation
vue-codemirror copied to clipboard

Should both camelCaseEvent and lowerCaseEvent be emitted?

Open zcqno1 opened this issue 5 years ago • 0 comments

VueCodeMirror emits both camelCaseEvent and lowerCaseEvent when the original codemirror event is fired. As most of the events are camel-cased, vue events almost double up.

When making a selection operation, CodeMirror fires too many events in a flash. And VueCodeMirror doubles them. Whether camel case or lower case, it's up to the developer. Most ofter, one of them is chosen as a specification. So, it may just waste half of the calculation.

BTW, when developing with the vue devtool, do some selection with your code and you will find the CPU goes too high because of the event panel tracking the events. Select more frequently, you may very likely get your vue tool crash. However, it is the CodeMirror who should take care of it.

image

CamelCaseEvent or lowerCaseEvent, it can be a choice, to cut down half of the event calculation. Default to both is ok.

zcqno1 avatar Apr 29 '20 10:04 zcqno1