Menu

Suggestion: Invert bookmarks

Dan Avni
2009-05-28
2012-11-13
  • Dan Avni

    Dan Avni - 2009-05-28

    please add to the search menu a command that will invert bookmarks on all lines

     
    • cchris

      cchris - 2009-05-28

      1/ Record a macro with keystrokes:
      <Ctrl+<Down arrow>

      2/ Go to top of document
      3/ Run macro multiple times, check "To end of document"

      Seems to just work.

      Granted, you'd like to be able to add a prologue, and perhaps an epilogue too, to the Run macro multiple times dialog, so that the initial Ctrl+d be handled too. This one would be an useful new feature.

      CChris

       
      • Fool4UAnyway

        Fool4UAnyway - 2009-05-28

        > <Ctrl+<Down arrow>

        Shouldn't this be?:
        Ctrl+F2
        Ctrl+CursorDown

        > This one would be an useful new feature.

        An alternative would be the ability to _un_mark matches from the Find dialog, allowing complex searches to find and (un)mark lines that do and/or do not contain combinations of matches.

        It would allow marking only those lines that do contain word A and not contain word B, by unmarking the lines already marked by the first search.

        An checkbox to mark or unmark should have to be added then.

         
        • Fool4UAnyway

          Fool4UAnyway - 2009-05-28

          This would also be a good starting point to name all highlighting and marking features consistently.

          In the Find Dialog there are:

          Mark Line = Set/Toggle Bookmark line in the Search menu

          Style found token = is there an equivalent?

          In the Search menu there is also

          Mark all
          Unmark all

          Those are different from the Mark Line in the Find dialog.

          Then there are also:

          smart highlighting
          highlighting from the incremental search

          Are there any other?

          I guess it would be a good thing to have an overview of these, preferrably with a screen shot of examples of all variations with the default styler colors.

           
          • Fool4UAnyway

            Fool4UAnyway - 2009-05-30

            I guess it would be a great tool if there was a dialog that would allow handling of lines, marked in _any_ way, based on the list composed on all possible types of marking, and all actions possible.

            Type:
            _ Bookmarked
            _ Marked (1)
            _ Marked (5)
            _ Marked (All)
            _ Syntax Highlighted
            _ ...

            Action:
            _ Cut
            _ Copy
            _ Paste (would be a little weird)
            _ Delete

            Target of action (or result):
            _ Current document (Cut, Delete)
            _ New document (Copy = Paste, Delete)

            Perhaps this would result in two general actions, Cut/Delete and Copy/Paste, with possibly a checkbox for also copying the processed lines (Deteled or Copied) to the Clipboard.

            So, cutting/deleting bookmarked lines to a new document would create a new document without the unwanted lines. Checking the Clipboard option would move the deleted lines to the Clipboard (or perhaps also to a new document?).

            Would that do? I think it would be _very_ convenient.

             
    • Dan Avni

      Dan Avni - 2009-05-29

      i know i can record a macro but my suggestion is to have this built into the editor and not have this as a macro. the feature exists in the textpad editor and i find it very usefull for filtering a text file to only lines containing specific strings:
      i bookmark all lines with the string, invert thebookmarks and delete all bookmarked lines. this way i am left with only the lines i need. on my specific case copy/paste the bookmarked lines to another file is not possible because of the size of the file (~300MB before filtering the lines)

      so it's true that a macro would work but a built in command would do it better

       
    • Sigvald Refsum

      Sigvald Refsum - 2009-05-29

      I do not know if an inverted bookmark would be useful for me, I guess not.

      An other bookmark feature which I would really like is the idea of bookmarks sets.
      You could created a namned  or numbered set from the currently active bookmarks.
      A namned or numbered set can be deativated, activated, saved and deleted.
      Only the currently active set can be added to, deleted from and navigated with the usual keys.
      An inactive set can either use an different colour or not be visible at all.

      Maybe this can be just a plugin.

       
    • cchris

      cchris - 2009-05-29

      1/ Instead of deleting unbookmarked lines, you can copy bookmarked lines, create a new file, paste there and go ahead.

      2/ Tgere is a review of the various search/mark/bookmark actions, at https://apps.sourceforge.net/mediawiki/notepad-plus/index.php?title=Searching_And_Replacing
      No screenshots so far, but once MediaWiki opens, volunteers will be able to post some. Thanks for reminding me I didn't include a few functions from TextFX besides Find/Replace. I'll add them tonight with luck.

      3/I'd suport the idea o bookmark groups, but sometimes you'll want to navigate through a union of them. Management could become a bit complicated, but I'd have some uses for it.

      CChris

       
    • Dan Avni

      Dan Avni - 2009-06-01

      i know about regex and how to use it. but that still needs me to find->copy->paste to a new file the lines i need. try to do that over RDP to a server with a 300MB file and i need about 30MB or 50MB of lines that match my find criteria. if i even try to copy 30MB to the clipboard, RDP will start to sync the clipboard of the server with my machine and that will take forever (i am talking from experience). however find->invert bookmarks->delete bookmarks will give the same result without the use of the clipboard.

       
      • Fool4UAnyway

        Fool4UAnyway - 2009-06-02

        Tell me, did you _read_ the thread I pointed to?

         
  • Roland Roderer

    Roland Roderer - 2011-05-12

    An alternative would be the ability to _un_mark matches from the Find dialog, allowing complex searches to find and (un)mark lines that do and/or do not contain combinations of matches.

    Sometimes I have to search lines using different filters. E.g. first I search lines including the text xyz. Next I look for lines including the text asdf, then the text lkjh and so on. All found lines shall be marked with bookmarks. The resulting lines I want to copy into a new file. All that I can do with notpad++. But if I use a filter which has a very big result (many lines which are now additionally bookmarked) sometimes I want to unmark only that lines of my last search.
    At this time I have to remove all bookmarks and repeat the previous searches again.

     
  • cchris

    cchris - 2011-05-12

    You may want to post a feature request for an "Undo last bookmark operation" command. This will be far from trivial, as any command that affects bookmarks will need to recall which lines it changed - your search filters may have overlapping results.

    CChris

     
  • Fool4UAnyway

    Fool4UAnyway - 2011-05-12

    > sometimes I want to unmark only that lines of my last search.

    Take a look at Digital Volcano's Text Crawler. This is a regular and regex text search and replace utility.

    www.digitalvolcano.co.uk/content/textcrawler

    It allows you to recursively search in previously matched files / lines and also has an option to use non-matches instead of matches (but possibly only for total files instead of single lines).

    I guess you could then use the last search results or just change the search parameters and perform a new search, or just use the list of previously found matches.

     
  • Roland Roderer

    Roland Roderer - 2011-05-13

    @CChris
    I think it is much easier as you are worried about. Assumed you search a string in a text using find->mark with the check box 'Mark line' is set, all matching lines will get a bookmark. If you press the 'Find All' Button again the marked lines will furthermore marked as before. But if you reset the check box 'Mark line' and then press the 'Find All' Button again the bookmarked lines could be unmarked - that's it!
    (At this time: if you press 'Find All' with the unchecked 'Mark line' the bookmarked lines will furthermore marked as before)

     
  • cchris

    cchris - 2011-05-13

    Yes, they will be unmarked. That is my concern, because the app doesn't know whether they were marked before being marked by the last search.
    So
    perform search 1, line 1 2 3 marked
    perform search 2, line 2 3 4 marked.
    Perform search 3, lines 3 4 5 are marked, so now 1 thru 5 are

    If no effort is made to remember the previous state, on reverting search 3, line 3+4 will be unmarked, This is wrong since searches 1 & 2 marked them.
    And if you repeat search 2, then line 1 is unmarked, which is wrong too.

    CChris

     
  • François-R Boyer

    I made a set of scripts (for PythonScript plugin) to "push", "pop", "invert", "and" and "or" bookmarks.  This will let you "undo" a bookmark operation, if you pushed bookmarks before.  This also let you unmark matching lines, instead of marking them (first push, then mark some lines, invert bookmarks, and finally "and" them together).
    The scripts can be found on NppPythonScript forum: https://sourceforge.net/projects/npppythonscript/forums/forum/1199074/topic/4529121
    Hope this could be useful…

     
  • cchris

    cchris - 2011-05-16

    @frboyer:
    Probably worth posting the link to the Scripting forum.

    CChris

     
MongoDB Logo MongoDB