MCPcopy
hub / github.com/philc/vimium / extendByOneCharacter

Method extendByOneCharacter

content_scripts/mode_visual.js:136–140  ·  view source on GitHub ↗
(direction)

Source from the content-addressed store, hash-verified

134 // Try to extend the selection by one character in direction. Return positive, negative or 0,
135 // indicating whether the selection got bigger, or smaller, or is unchanged.
136 extendByOneCharacter(direction) {
137 const length = this.selection.toString().length;
138 this.selection.modify("extend", direction, character);
139 return this.selection.toString().length - length;
140 }
141
142 // Get the direction of the selection. The selection is "forward" if the focus is at or after the
143 // anchor, and "backward" otherwise.

Callers 5

runMovementMethod · 0.95
getDirectionMethod · 0.95
initMethod · 0.80
initMethod · 0.80
commandHandlerMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected