Community
    • 登入

    npp search goes in unending loop, doesn't end where we started

    已排程 已置頂 已鎖定 已移動 General Discussion
    3 貼文 3 Posters 2.2k 瀏覽
    正在載入更多貼文
    • 從舊到新
    • 從新到舊
    • 最多點贊
    回覆
    • 在新貼文中回覆
    登入後回覆
    此主題已被刪除。只有擁有主題管理權限的使用者可以查看。
    • V S RawatV
      V S Rawat
      最後由 編輯

      when we search in npp, in search/ replace box or by f3-shift-f3, the search goes in unending loop,
      meaning, it keeps on presenting next occurrences of the word.
      it doesn’t end where we started.

      I mean it should remember where we had started, and once it has travelled to the end, and wrapped to the start of file and has travelled from the start of file to the position where we had originally started, it should stop there.

      That is what MS Word does, it remembers where we started, and seaches through the entire file only one time.

      Thanks.

      1 條回覆 最後回覆 回覆 引用 1
      • Training SuratT
        Training Surat
        最後由 dail 編輯

        Occasionally I use NPP to manipulate bits of text and more often than not I use regular expressions during that process. While it is no criticism of the product (how can it be?), Notepad++ allows me to do stupid things that don’t behave as I intended. Case in point, I had a long list of values which I wanted to enclose in quote marks. I entered an accidentally aggressive expression and it caused an infinite loop.

        The reason for the loop is immaterial and is not the point of my question - I’ve made this mistake more than once - i know it doesn’t work, but I forget and months later will do the same thing again.

        The problem is that when NotePad++ goes into this infinite loop, trying to complete the imposisble, I am effectively locked out of all of my unsaved documents and forced to kill the NPP process.

        1 條回覆 最後回覆 回覆 引用 1
        • glennfromiowaG
          glennfromiowa
          最後由 編輯

          @Training-Surat Thank God for Periodic Backup, right? Regular Expressions are an art as much as a science, but having said that, I’m aware of ways that Notepad++ does it less than ideally. But I agree that what it does, for the price, is absolutely awesome!

          @V-S-Rawat Half-jokingly, I say, “It’s not a bug, it’s a feature!” There have been discussions here where a user says, “I wish Notepad++ did [something] like [some program].” Then it gets implemented, and lots of other users complain because it doesn’t work like it used to. :)

          I understand what you’re saying, and sometimes it frustrates me too that I need to remember what line I started on. However, there are other times where I want to search for or replace a repeated part, and after I’ve been through the file once, there are still more instances that are repeated more than once, so that feature can come in handy. Here are some tips (used together or individually) to overcome this difference in functionality:

          • Use the count feature to count the number of occurrences before actually finding the text.
          • Set a bookmark (Ctrl-F2) before searching, then return to the bookmark after search (F2).
          • Go to the top of the file, use the Search/Replace box, and un-check the Wrap around checkbox

          There are probably more ways to manage this, but those are the ones I use when I absolutely have to get back to where I started when I’m finished.

          1 條回覆 最後回覆 回覆 引用 2
          • 第一個貼文
            最後的貼文
          The Community of users of the Notepad++ text editor.
          Powered by NodeBB | Contributors