Line numbers start counting from cursor position
Closed this issue · 6 comments
v0.11.19
vscode:
Version: 1.87.2
Commit: 863d2581ecda6849923a2118d93a088b0745d9d6
Date: 2024-03-08T15:20:57.520Z
Electron: 27.3.2
ElectronBuildId: 26836302
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Darwin arm64 23.4.0
I discovered a strange bug where the line numbers start counting from the cursor position when I use the print command instead of starting from 1.
I just wanted you to know that we will get this this issue after build pipeline problems are resolved.
The build pipeline is still a shambles but I am at least now able to do manual publishing to the marketplace.
I think I know what's going on with this bug you found. The line number starting from the start line of the current selection is correct behaviour for printing a selection. Now I just have to step through that block of code to see why it's using that.
Interestingly it doesn't happen on my system using Windows. I have a Mac for testing, looks like I'll be setting it up again.
It's not happening on my Mac either. I really hate this kind of mystery.
Steve, can you still reproduce this with the latest release?
@PeterWone I just tried, and it seems I still do with v0.11.28.
Finally managed to reproduce this when a colleague reproduced a variant of the same problem. It also occurs for unsaved files. For that specific execution path there was an if statement with a faulty condition making it report selection
. Other code was correcting most of the problem but it was setting the starting line number to the beginning of the selection. There must be another bug, this one platform dependent, causing tilde paths to fail to match the doc URI path, in order to hit that branch. You really did have a perfect storm going on there.