@guy038 said:
Thank you for taking a look at this!
Now, using the Remove marks from active document option ( Ctrl + Shift + R ), it deleted any marked text. However the bookmarks remain.
Is this behavior logical as you said that, even when the Bookmark lines when marking text is not checked, the Keep bookmarks synchronized with marked text option is still honored ?
It is behaving as designed, though the intent may be unclear. For the record, what I wrote was:
The Bookmark lines when marking text option at the bottom right is identical to the menu setting; it’s just in this dialog so you don’t have to open the menu a second time to see or change it. The other options in this dialog are only relevant when this box is checked; unchecking it, or the equivalent menu setting, keeps Search++ from doing anything with bookmarks, with one exception: the new Synchronize bookmarks to marked text command.
The new Synchronize bookmarks to marked text command applies the policy selected for Bookmark every line containing marked text or Bookmark only the first line of each match or selection regardless of any other settings, including Bookmark lines when marking text.
The Keep bookmarks synchronized with marked text option only applies to Tools menu commands that affect bookmarks, except for the special cases listed: Remove marks from multiple documents… (which has a check box in the dialog) and Synchronize bookmarks to marked text (which always does what it says). Except for Synchronize bookmarks to marked text, Tools menu commands do not affect bookmarks unless Bookmark lines when marking text is checked.
I think the design makes sense, but I wish I knew how to make it more obvious. You turn Bookmark lines when marking text on or off depending on whether you want Search++ to manipulate bookmarks at all. The only exception is Synchronize bookmarks to marked text, because it’s the only command that has no other effect than to manipulate bookmarks. (I could disable that command when Bookmark lines when marking text is unchecked, but I don’t see the point. As it is, it’s a quick way to get bookmarks for marked text even if you usually don’t want Search++ messing with your bookmarks.)
THIRD test :
Again, I marked the two words with a Mark command. Thus, the snapshot below :
[image: 1790513778688-af1745d6-6e7e-4036-a04f-e86675835818-image.jpeg]
Then, I used the Invert marked text option ( Crl + Shift + I ). I got this snapshot :
[image: 1790513817663-c0bbc189-4c13-4fd8-a8d3-a2920d7ad3c4-image.jpeg]
That’s not exactly what I expected !
It worked as designed, but the design might not be very useful.
I wanted to invert all the bookmarks, FIRST and SECONDLY, mark the contents of all the lines having a bookmark !
That’s an interesting thought. Not what Invert marked text does, but interesting. Invert mark test proceeds in the opposite manner: first it marks every character that wasn’t marked and unmarks every character that was marked. Then, depending on the bookmark options, it either does nothing with bookmarks or it bookmarks every line containing any marked text (or the first line of each unbroken span of marked text, depending on the every line / first line setting).
To do so, instead of searching the test word, I needed to use the regex ^((?!test).)*$ and I chose again the Mark command to get this behavior.
Of course, @coises, to imagine the negative regex ^((?!test).)*$ compared to the positive regex test is easy enough with that simple example. However, how to quickly determine a correct negative regex vs a complicated positive regex ?
I did think of Invert marked text as a way to search in a negative space, but I didn’t think of someone perhaps wanting to apply it to whole lines rather than to characters.
I did notice that (with or without bookmarks, but more obvious with them) the results of Invert marked text can be unexpected, because line endings count as characters for which marking is inverted. If you have Keep bookmarks synchronized with marked text checked and you aren’t showing line endings, unexpected bookmarks can appear where there seems to be nothing marked, because the line endings are marked.
So far, I haven’t had a “real world” case where I wanted Invert marked text for anything, but it hasn’t been available (even to me) for all that long yet.
I have to consider this some more, but I’m thinking that Invert marked text isn’t something that would be used very often, so it doesn’t have to be one click: it might be better to replace the single action with a dialog that lets you choose details about how you want to “negate” the text indicated by marks.
Suggestions welcome!