Is there any VSCode API that let me know the physical line cursor is on?

  Kiến thức lập trình

In the VS Code API you can get the line number the cursor is on from vscode.window.activeTextEditor.selection.active. The line returned is the logical line that counts the number of new lines that show up before the cursor.

Now I want to have the number of lines shown on the display before the cursor position. That may be different then the value above if I have code folding or line wrapping.

Is there any API function that returns such value?

Thanks.

I tried to find something in the VS Code documentation available online, but failed to find the info I want.

LEAVE A COMMENT