load-vmp-commands.js 501 B

123456789101112131415161718192021
  1. module.exports = function (getClass, toggle) {
  2. class QuickHighlight extends getClass('Operator') {
  3. initialize () {
  4. this.flashTarget = false
  5. this.stayAtSamePosition = true
  6. return super.initialize()
  7. }
  8. mutateSelection (selection) {
  9. toggle(selection.getText())
  10. }
  11. }
  12. class QuickHighlightWord extends QuickHighlight {
  13. initialize () {
  14. this.target = 'InnerWord'
  15. return super.initialize()
  16. }
  17. }
  18. return {QuickHighlight, QuickHighlightWord}
  19. }