You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Double clicking on result from Find In Files does not go to that line #12484
RStudio Edition : Desktop
RStudio Version : Version 2022.12.0+353
OS Version : macOS 11.7
R Version : R version 4.2.1 (2022-06-23)
Steps to reproduce the problem
I'm in a Quarto book project with many files (the R Packages book).
I am using "Find in Files" intensely these days and the clickable file+line results that I get in the "Find in Files" pane consistently do NOT cause the associated line to appear in the source editor. I always find myself staring at an earlier part of the file. Exactly how much earlier varies.
Describe the problem in detail
In R Packages, search for a word using "Find in Files". Click on one of the results. Notice you are not, in fact, looking at the relevant line.
Describe the behavior you expected
When I click on n: below path/to/some/file, I expect to be taken to line n in path/to/some/file.
I can't reproduce this in 2022.12.0+353 on MacOS 13.2—the cursor is going to the correct line—including using after checking out the R packages book. I'll try this on MacOS 11 and see if that makes a difference.
@ronblum I have the sense that the visual editor some how comes into play in this. So you might need to open a chapter, switch to visual mode, then close the chapter, then re-open from find in files. Or maybe it already needs to be currently open and visual mode? Or maybe it has to be closed? I think there's some extra step in there.
Ah, now I can reproduce it following those steps, and now it's consistently wrong—I can't get it to work. I can reproduce it in 2022.07.2+576, as well.
Activity
jennybc commentedon Dec 21, 2022
Here's a recording of the problem in action.
find-in-files-wrong-location.mov
hadley commentedon Dec 21, 2022
I've seen this too.
kevinushey commentedon Dec 22, 2022
Just to confirm, the search results plus resulting cursor position is correct; however, it seems like the cursor isn't properly scrolled into view?
Does the cursor scroll into view if you do something like move the cursor up or down with the keyboard?
jennybc commentedon Dec 22, 2022
Now that you mention it, yes, correct.
Yes, also true. That causes the cursor-harbouring line to come into view, as the very last line in the editor.
ronblum commentedon Dec 22, 2022
I can't reproduce this in 2022.12.0+353 on MacOS 13.2—the cursor is going to the correct line—including using after checking out the R packages book. I'll try this on MacOS 11 and see if that makes a difference.
hadley commentedon Dec 22, 2022
@ronblum I have the sense that the visual editor some how comes into play in this. So you might need to open a chapter, switch to visual mode, then close the chapter, then re-open from find in files. Or maybe it already needs to be currently open and visual mode? Or maybe it has to be closed? I think there's some extra step in there.
jennybc commentedon Dec 22, 2022
Also the presence/absence of the Outline may come into play.
jennybc commentedon Dec 22, 2022
Try this in R Packages:
Open
dependencies-in-practice.Rmd. Make sure it's in Visual mode and the Outline is visible. Close the file.Use Find in Files to find "sec-ci".
It should be found in
dependencies-in-practice.Rmdon line 531, among other locations.Double click on that and, at least for me, the phenomenon shown in the video happens.
ronblum commentedon Dec 22, 2022
Ah, now I can reproduce it following those steps, and now it's consistently wrong—I can't get it to work. I can reproduce it in 2022.07.2+576, as well.
kevinushey commentedon Dec 27, 2022
Does it reproduce in documents that are already open in the IDE, or only if navigating to that line would for the IDE to open a new tab for that file?