MCPcopy Index your code
hub / github.com/philc/vimium / getNextForwardCharacter

Method getNextForwardCharacter

content_scripts/mode_visual.js:21–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19 // Return the character following (to the right of) the focus, and leave the selection unchanged,
20 // or return undefined.
21 getNextForwardCharacter() {
22 const beforeText = this.selection.toString();
23 if ((beforeText.length === 0) || (this.getDirection() === forward)) {
24 this.selection.modify("extend", forward, character);
25 const afterText = this.selection.toString();
26 if (beforeText !== afterText) {
27 this.selection.modify("extend", backward, character);
28 return afterText[afterText.length - 1];
29 }
30 } else {
31 return beforeText[0]; // The existing range selection is backwards.
32 }
33 }
34
35 // Test whether the character following the focus is a word character (and leave the selection unchanged).
36 nextCharacterIsWordCharacter() {

Callers 3

runMovementMethod · 0.95
selectLineMethod · 0.95

Calls 1

getDirectionMethod · 0.95

Tested by

no test coverage detected