Fix openfile navigation jumping to wrong line#11
Open
pgmail wants to merge 1 commit intoruben2020:masterfrom
Open
Fix openfile navigation jumping to wrong line#11pgmail wants to merge 1 commit intoruben2020:masterfrom
pgmail wants to merge 1 commit intoruben2020:masterfrom
Conversation
vscode.Position uses 0-based line numbers but cqsearch returns 1-based line numbers. Also added editor.selection to actually move the cursor, not just scroll the viewport. Without setting the selection, the cursor stayed at its previous position while the view scrolled, causing apparent random offsets of 20-30 lines.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When clicking a search result, the cursor was landing on the wrong
line, typically 20-30 lines away from the correct position.
Two bugs were fixed in the openfile() method of cqtreedataprov.ts:
vscode.Position uses 0-based line numbers but cqsearch returns
1-based line numbers, so 1 is now subtracted from the line number.
editor.selection was never set, so the cursor never actually moved.
It stayed at its previous position while revealRange() only scrolled
the viewport, giving the appearance of a large random offset.
Tested on Linux (Debian 13).