MCPcopy
hub / github.com/VSCodeVim/Vim / execActionWithCount

Method execActionWithCount

src/actions/motion.ts:830–863  ·  view source on GitHub ↗
(
    position: Position,
    vimState: VimState,
    count: number,
  )

Source from the content-addressed store, hash-verified

828 keys = ['f', '<character>'];
829
830 public override async execActionWithCount(
831 position: Position,
832 vimState: VimState,
833 count: number,
834 ): Promise<Position | IMovement> {
835 if (configuration.sneakReplacesF) {
836 const pos = await new SneakForward(
837 this.keysPressed.concat('\n'),
838 this.isRepeat,
839 ).execActionWithCount(position, vimState, count);
840 if (vimState.recordedState.operator && !isIMovement(pos)) {
841 return pos.getRight();
842 }
843
844 return pos;
845 }
846
847 count ||= 1;
848 const toFind = Notation.ToControlCharacter(this.keysPressed[1]);
849 let result = findHelper(vimState, position, toFind, count, 'forward');
850
851 vimState.lastSemicolonRepeatableMovement = new MoveFindForward(this.keysPressed, true);
852 vimState.lastCommaRepeatableMovement = new MoveFindBackward(this.keysPressed, true);
853
854 if (!result) {
855 return failedMovement(vimState);
856 }
857
858 if (vimState.recordedState.operator) {
859 result = result.getRight();
860 }
861
862 return result;
863 }
864}
865
866@RegisterAction

Callers

nothing calls this directly

Calls 7

isIMovementFunction · 0.90
failedMovementFunction · 0.90
findHelperFunction · 0.85
getRightMethod · 0.80
ToControlCharacterMethod · 0.80
execActionWithCountMethod · 0.65
concatMethod · 0.45

Tested by

no test coverage detected