@guy038 said:
This time, I would avoid any option that excludes the EOLs and I propose this new sub-menu :
A Invert only the marked text
B Invert only the bookmarks
D Invert bookmarks, then mark all text and EOL of the bookmarked lines
C Invert marked text, then bookmark all lines containing marked text
Note that running, consecutively, the A and B actions is equivalent to the D action
No, it isn’t. If you search for something using the Mark command, only the text that actually matches is marked. Invert marked text marks everything that wasn’t marked and unmarks everything that was marked, so it marks the text surrounding the matches but leaves gaps where the matches were. Potentially useful if you want to search only text that the last search didn’t match.
If you had Bookmark lines when marking text checked when you did that Mark command, there will have been a bookmark on every line that contained any marked text. If you then Invert bookmarks, the bookmarks will be only on lines that had no marked text at all.
Put the two together and you’ll have marked text with gaps where the original matches were, and bookmarks only on lines that have no gaps.
Invert bookmarks and mark only bookmarked lines would bookmark the same lines as the above process, but every bookmarked line (that is, every line that originally contained no part of any match) would have all its text marked. The details of which parts of lines matched and which didn’t would be completely lost.
An additional complication is zero-length matches. It is impossible to mark a zero-length match; but when marking with Bookmark lines when marking text checked, the lines containing zero-length matches are still bookmarked.
When you invert bookmarks, a line containing one or more zero-length matches will then not be bookmarked. If you invert bookmarks first and then mark the bookmarked lines, that line won’t be bookmarked or marked. If you invert the marks and the bookmarks separately, the line will be fully marked (because it had no marked text), but not bookmarked.
You might have meant to say that A followed by B is equivalent to C, rather than D. However, in the zero-length match case, option C would bookmark the line that previously contained only zero-length matches (since it would now be fully marked).
I’m still not sure what will be useful and what won’t be; I just wanted to note that it does make a difference whether you invert marks and bookmarks separately or whether you invert one and then derive the other by synchronizing.
And of course, if you have marked text that wasn’t marked with bookmarking on, or if you added or removed bookmarks by hand, that would also lead to different results for the various operations.