Community
    • Login

    Bug: Find in Files opens new copy

    Scheduled Pinned Locked Moved Help wanted · · · – – – · · ·
    4 Posts 2 Posters 1.1k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Sarah NorthwayS
      Sarah Northway
      last edited by

      I’ve regularly got ~20 files open, and sometimes I clone one to a second view on the right side. If I modify that file on the left, the copy to the right is immediately changed as well, even before hitting save. This is a very useful feature!

      The problem happens if I use Find in File, and in the results show a file which is already open. If I double-click the results line it will open a new copy of the file. But this one is disconnected from the other(s) already open. If I type in one, the changes are NOT reflected in the other.

      So I can work on one copy of the file, then accidentally switch to the second and work on that one. When I save, it quietly overwrites the other in the filesystem. N++ doesn’t notice until I switch out to another program and back, then it pops up “This file has been modified by another program” (The other program was N++) and prompts me to reload. Worst case I lose work, best case I have to merge the two copies.

      It would be best if Find in Files jumped to an already-open copy of a file rather than open a new instance. It would also help if all copies of a file were kept in sync no matter how they were opened.

      Scott SumnerS 1 Reply Last reply Reply Quote 2
      • Scott SumnerS
        Scott Sumner @Sarah Northway
        last edited by

        @Sarah-Northway

        I am unable to replicate what you are seeing, at least with Notepad++ 64-bit version 7.5.6. It works as I expect (which is definitely different than your experience). Can you provide the ? menu -> Debug Info... from the version you are encountering this with?

        1 Reply Last reply Reply Quote 0
        • Scott SumnerS
          Scott Sumner
          last edited by

          I do notice, however, that if I exit Notepad++ with a cloned file modified but unsaved, the next time I run, the originally cloned files still appear to be cloned (otherwise a single file should not be loaded into TWO N++ editor tabs) and still show the unsaved changes, but they are no longer linked, i.e., changes in one do NOT affect the other!

          1 Reply Last reply Reply Quote 1
          • Sarah NorthwayS
            Sarah Northway
            last edited by

            Confirm I see the issue you’re describing in 7.5.7 (unsaved changes cause clones to de-link). This is definitely part of my problem.

            But I just realized my issue with find-in-files opening a new de-linked copy is due to windows junctions. I’d somehow opened the files with the actual location then was searching via the junction folder. Notepad++ probably has no way of knowing it’s a symbolic link to the same file. Symlinks are trouble. :/

            1 Reply Last reply Reply Quote 1
            • First post
              Last post
            The Community of users of the Notepad++ text editor.
            Powered by NodeBB | Contributors