aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--README.md1
-rw-r--r--content_scripts/mode.coffee12
-rw-r--r--content_scripts/mode_insert.coffee2
-rw-r--r--content_scripts/mode_visual_edit.coffee4
-rw-r--r--lib/dom_utils.coffee5
-rw-r--r--lib/handler_stack.coffee2
-rw-r--r--pages/options.coffee2
-rw-r--r--tests/unit_tests/handler_stack_test.coffee2
8 files changed, 10 insertions, 20 deletions
diff --git a/README.md b/README.md
index 7d4172d1..748dfc74 100644
--- a/README.md
+++ b/README.md
@@ -172,6 +172,7 @@ Next version (not yet released)
measured from the top of the window (and a multiple of `scrollStepSize`).
- `moveTabToNewWindow` now accepts a count prefix; so, `3W` moves three tabs to
(the same) new window.
+- With smooth scrolling, `2j`-and-hold now gives a faster scroll than `j`-and-hold.
- You can now bind keys to a command with a defined count prefix; see
[here](https://github.com/philc/vimium/wiki/Command-Options#count-prefixes)
for details.
diff --git a/content_scripts/mode.coffee b/content_scripts/mode.coffee
index 5cc8800e..454a6ed9 100644
--- a/content_scripts/mode.coffee
+++ b/content_scripts/mode.coffee
@@ -117,7 +117,7 @@ class Mode
key = Utils.getIdentity @options.singleton
@onExit -> delete singletons[key]
@deactivateSingleton @options.singleton
- singletons[key] = @
+ singletons[key] = this
# If @options.trackState is truthy, then the mode mainatins the current state in @enabled and @passKeys,
# and calls @registerStateChange() (if defined) whenever the state changes. The mode also tracks the
@@ -164,7 +164,7 @@ class Mode
keypress: handler
keyup: -> handlerStack.stopBubblingAndFalse
- Mode.modes.push @
+ Mode.modes.push this
@setIndicator()
@logModes()
# End of Mode constructor.
@@ -194,7 +194,7 @@ class Mode
@modeIsExiting = true
handler args... for handler in @exitHandlers
handlerStack.remove handlerId for handlerId in @handlers
- Mode.modes = Mode.modes.filter (mode) => mode != @
+ Mode.modes = Mode.modes.filter (mode) => mode != this
@modeIsActive = false
@setIndicator()
@@ -213,12 +213,6 @@ class Mode
DomUtils.suppressPropagation event
@stopBubblingAndFalse
- # Activate a new instance of this mode, together with all of its original options (except its main
- # keybaord-event handlers; these will be recreated).
- cloneMode: ->
- delete @options[key] for key in [ "keydown", "keypress", "keyup" ]
- new @constructor @options
-
# Debugging routines.
logModes: ->
if @debug
diff --git a/content_scripts/mode_insert.coffee b/content_scripts/mode_insert.coffee
index 9037b05a..f86038d6 100644
--- a/content_scripts/mode_insert.coffee
+++ b/content_scripts/mode_insert.coffee
@@ -77,7 +77,7 @@ class InsertMode extends Mode
shadowRoot.removeEventListener type, listener, true
# Only for tests. This gives us a hook to test the status of the permanently-installed instance.
- InsertMode.permanentInstance = @ if @permanent
+ InsertMode.permanentInstance = this if @permanent
isActive: (event) ->
return false if event == InsertMode.suppressedEvent
diff --git a/content_scripts/mode_visual_edit.coffee b/content_scripts/mode_visual_edit.coffee
index ae8897ca..cca305f8 100644
--- a/content_scripts/mode_visual_edit.coffee
+++ b/content_scripts/mode_visual_edit.coffee
@@ -274,7 +274,7 @@ class Movement extends CountPrefix
handleMovementKeyChar: (keyChar, count = 1) ->
switch typeof @movements[keyChar]
when "string" then @runMovement @movements[keyChar] for [0...count]
- when "function" then @movements[keyChar].call @, count
+ when "function" then @movements[keyChar].call this, count
@scrollIntoView()
constructor: (options) ->
@@ -307,7 +307,7 @@ class Movement extends CountPrefix
return @continueBubbling if command == "0" and 0 < @countPrefix.length
if @commands[command]
- @commands[command].call @, @getCountPrefix()
+ @commands[command].call this, @getCountPrefix()
@scrollIntoView()
return @suppressEvent
diff --git a/lib/dom_utils.coffee b/lib/dom_utils.coffee
index 553287af..aab0a4df 100644
--- a/lib/dom_utils.coffee
+++ b/lib/dom_utils.coffee
@@ -290,11 +290,6 @@ DomUtils =
@remove()
false
- simulateTextEntry: (element, text) ->
- event = document.createEvent "TextEvent"
- event.initTextEvent "textInput", true, true, null, text
- element.dispatchEvent event
-
# Adapted from: http://roysharon.com/blog/37.
# This finds the element containing the selection focus.
getElementWithFocus: (selection, backwards) ->
diff --git a/lib/handler_stack.coffee b/lib/handler_stack.coffee
index c07d028b..bb0f19a6 100644
--- a/lib/handler_stack.coffee
+++ b/lib/handler_stack.coffee
@@ -45,7 +45,7 @@ class HandlerStack
# A handler may have been removed (handler.id == null), so check.
if handler?.id and handler[type]
@currentId = handler.id
- result = handler[type].call @, event
+ result = handler[type].call this, event
@logResult eventNumber, type, event, handler, result if @debug
if not result
DomUtils.suppressEvent event if @isChromeEvent event
diff --git a/pages/options.coffee b/pages/options.coffee
index 51400740..a82c3807 100644
--- a/pages/options.coffee
+++ b/pages/options.coffee
@@ -21,7 +21,7 @@ class Option
@element = $(@field)
@element.addEventListener "change", @onUpdated
@fetch()
- Option.all.push @
+ Option.all.push this
# Fetch a setting from localStorage, remember the @previous value and populate the DOM element.
# Return the fetched value.
diff --git a/tests/unit_tests/handler_stack_test.coffee b/tests/unit_tests/handler_stack_test.coffee
index 0ed85e63..629fc3ed 100644
--- a/tests/unit_tests/handler_stack_test.coffee
+++ b/tests/unit_tests/handler_stack_test.coffee
@@ -63,7 +63,7 @@ context "handlerStack",
assert.isFalse @handler1Called
should "handle self-removing handlers correctly", ->
- ctx = @
+ ctx = this
@handlerStack.push { keydown: => @handler1Called = true }
@handlerStack.push { keydown: ->
ctx.handler2Called = true