Skip to content

Double clicking on result from Find In Files does not go to that line #12484

Open

Description

@jennybc

System details

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 have read the guide for submitting good bug reports.
  • I have installed the latest version of RStudio, and confirmed that the issue still persists.
  • If I am reporting an RStudio crash, I have included a diagnostics report.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.

Activity

  1. added
    new
    on Dec 21, 2022
  2. jennybc commented on Dec 21, 2022

    @jennybc
    MemberAuthor

    Here's a recording of the problem in action.

    find-in-files-wrong-location.mov
  3. hadley commented on Dec 21, 2022

    @hadley
    Member

    I've seen this too.

  4. kevinushey commented on Dec 22, 2022

    @kevinushey
    Collaborator

    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?

  5. jennybc commented on Dec 22, 2022

    @jennybc
    MemberAuthor

    Just to confirm, the search results plus resulting cursor position is correct; however, it seems like the cursor isn't properly scrolled into view?

    Now that you mention it, yes, correct.

    Does the cursor scroll into view if you do something like move the cursor up or down with the keyboard?

    Yes, also true. That causes the cursor-harbouring line to come into view, as the very last line in the editor.

  6. ronblum commented on Dec 22, 2022

    @ronblum
    Contributor

    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.

  7. added
    find in files
    and removed
    new
    on Dec 22, 2022
  8. self-assigned this
    on Dec 22, 2022
  9. hadley commented on Dec 22, 2022

    @hadley
    Member

    @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.

  10. jennybc commented on Dec 22, 2022

    @jennybc
    MemberAuthor

    Also the presence/absence of the Outline may come into play.

  11. jennybc commented on Dec 22, 2022

    @jennybc
    MemberAuthor

    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.Rmd on line 531, among other locations.

    Double click on that and, at least for me, the phenomenon shown in the video happens.

  12. ronblum commented on Dec 22, 2022

    @ronblum
    Contributor

    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.

  13. added this to the Backlog-2 milestone on Dec 22, 2022
  14. removed their assignment
    on Dec 22, 2022
  15. kevinushey commented on Dec 27, 2022

    @kevinushey
    Collaborator

    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?

  16. modified the milestones: Backlog-2, Later on Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugfind in files

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions