Community
    • Login

    New feature: Allow additional line on each search results

    Scheduled Pinned Locked Moved General Discussion
    5 Posts 3 Posters 95 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.
    • Alain SavardA
      Alain Savard
      last edited by

      When displaying search results, say it finds something on line 53 and 104…Have an option to show say 3 more lines. So the results would show 53 to 56 and 104 to 107.

      Reason is that code is often formatted like
      dosomething(param1,
      param2,
      param3);

      And we might want to see what is on line 3.

      Alan KilbornA 1 Reply Last reply Reply Quote 0
      • Alan KilbornA
        Alan Kilborn @Alain Savard
        last edited by

        @Alain-Savard

        Something like this has been proposed before, and I’ll have to assume that the developer and other code contributors, while they recognize the value of the idea, have thought that implementing it might be awkward – not coding it, but rather what the resulting solution looked like. So…I wouldn’t count on seeing it natively in Notepad++.

        However, it might be a nice suggestion for the Search++ plugin.

        CoisesC 1 Reply Last reply Reply Quote 2
        • CoisesC
          Coises @Alan Kilborn
          last edited by

          @Alan-Kilborn said in New feature: Allow additional line on each search results:

          However, it might be a nice suggestion for the Search++ plugin.

          Noted. This is certainly the time to consider it, while things are still unstable and I’m not hesitant to make potentially breaking changes. (Not that I expect to get beyond that state for at least a couple of months yet.) It would probably entail redesigning the way I create a search results list, especially if it is to be dynamic (i.e., that you can decide after you’ve done the search that you need to see more context).

          @Alain-Savard, if you’re interesting in weighing in on this plugin-in-progress (I’m the author), there’s a thread about it here.

          1 Reply Last reply Reply Quote 1
          • Alan KilbornA
            Alan Kilborn
            last edited by

            @Coises

            I can’t tell if you’ve considered this, but one way to do it would be in conjunction with hiding lines. You could hide lines that don’t meet the criterion of -M through +N, where M would be a user-chosen number of lines before the hit, and N a user-selected count of lines after the search match.

            CoisesC 1 Reply Last reply Reply Quote 2
            • CoisesC
              Coises @Alan Kilborn
              last edited by

              @Alan-Kilborn said in New feature: Allow additional line on each search results:

              @Coises

              I can’t tell if you’ve considered this, but one way to do it would be in conjunction with hiding lines. You could hide lines that don’t meet the criterion of -M through +N, where M would be a user-chosen number of lines before the hit, and N a user-selected count of lines after the search match.

              At first thought, I believe that would be significantly easier to implement than doing it in the search results window. As a plus, it (or a close approximation) could even be available after the search with something like an “expand visible blocks” command.

              The downside is that Show commands only work on the current document; you can’t show in all open documents (and it wouldn’t even make sense for find in files, whenever I finally get that done). At present, my use of hidden lines (using Scintilla’s function directly) and Notepad++’s way of doing it (keeping its own internal table, inaccessible to plugins, of what ranges are hidden) are at odds with one another, which causes any changes my plugin has made to hidden lines to be lost when any other tab is switched into the view. Thus far, I have not been able to devise any solution to this.

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