How can I mark multiples selected lines (to use with F2 after)
-
Hi!
I want to select multiple lines (lines are in sequence)
and, some how, mark them soExample:
1 random text of line 1
2 random text of line 2
3 random text of line 3
…
N-1 random text of line N-1
N random text of line NI want to select lines 2 to N - 1 and mark them
so i can use F2 to navigate between them (or any other possible marker’s action)I can’t use the FIND\MARK line cause the text in the selected lines is random.
Thanks in advance for any help!
Sorry about my English ( -
I am not 100% sure I understand what you want, but I have a guess.
My original thought was that you’d be able to just select all N lines with shift-and-arrows or dragging the mouse, then hitting
Ctrl+F2
to bookmark, but that only bookmarks the last line in the selection.So instead,
- Select all N lines with shift-and-arrows or dragging the mouse
Ctrl+M
(or Search > Mark) to bring up the Mark dialog- Fill out the Mark dialog:
- Find what:
\R
- enable ☑ Bookmark line (this turns on bookmarking)
- enable ☑ In Selection (the block should still be selected from step 1)
- set Search Mode to ☑ Regular expression
- click Mark All
- Find what:
At this point,
F2
(Next bookmark) should take you to the next bookmarked lineIf the last line of your selection happened to be the last line in the file, with no EOL sequence, that expression might miss the last line. You can either then manually bookmark that line (
Ctrl+F2
or click in the bookmark column of the GUI), or you could change the expression to something like\R|^.*\Z
… -
@PeterJones said in How can I mark multiples selected lines (to use with F2 after):
to something like \R|^.*\Z …
Or
\R|.\z
Interestingly, I noticed that with the above expression and a partial-line selection on the last line of the file, the character that gets marked (in red, because of the
.
) is the last character in the selection.Aside: Note that I used the single
.
because\z
by itself won’t cause the bookmark to happen because the marking operation doesn’t register zero-length assertions.I do understand why this happens… ; with an In selection search, we have to be careful in our thinking about
\z
being strictly an “end-of-file” thing. In this case it is more of an “end-of-selection” thing. :-)BTW, the @PeterJones solution is one that cries out for a macro to be recorded for it, so that it appears as a nice command in the Macro menu and can optionally be tied to a keycombo for quick usage.
-
A reference to a very similar topic is HERE.
-
@PeterJones said in How can I mark multiples selected lines (to use with F2 after):
\R
YES… you nailed!
I forgot about the mark + regular expression + \R stuff
:)Thanks, Peter!
-
@Alan-Kilborn said in How can I mark multiples selected lines (to use with F2 after):
BTW, the @PeterJones solution is one that cries out for a macro to be recorded for it, so that it appears as a nice command in the Macro menu and can optionally be tied to a keycombo for quick usage.
Thanks for you extended explanation abou the problem, Alan!
I will put both solutions on macros tu use with a key combo.