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

Method getFirstNonWhitespaceCharOnLine

src/textEditor.ts:195–201  ·  view source on GitHub ↗

* @returns the Position of the first character on the given line which is not whitespace. * If it's all whitespace, will return the Position of the EOL character.

(
    document: vscode.TextDocument,
    line: number,
  )

Source from the content-addressed store, hash-verified

193 * If it's all whitespace, will return the Position of the EOL character.
194 */
195 public static getFirstNonWhitespaceCharOnLine(
196 document: vscode.TextDocument,
197 line: number,
198 ): Position {
199 line = clamp(line, 0, document.lineCount - 1);
200 return new Position(line, document.lineAt(line).firstNonWhitespaceCharacterIndex);
201 }
202
203 /**
204 * Iterate over every line in the block defined by the two positions (Range) passed in.

Callers 15

motion.test.tsFile · 0.80
getNewPositionMethod · 0.80
execActionWithCountMethod · 0.80
execActionWithCountMethod · 0.80
execActionWithCountMethod · 0.80
execActionMethod · 0.80
execActionFunction · 0.80
runMethod · 0.80
runMethod · 0.80
runMethod · 0.80

Calls 1

clampFunction · 0.90

Tested by

no test coverage detected