Hi!
I just found the option to do rectangular selections (option+mouse), and I was thrilled, as I need to replace some text on many lines.
And I've been using the similar option in TextMate while programming.
There it's really simple: Select the text, press option to make it rectangular (without touching the mouse) and then delete, insert text or do whatever.
In Nisus Writer Pro (2.x) however, I was able to delete/cut the rectangle, but inserting/typing only happened on the first/current line.
Is this intentional? Is there a way to edit multiple lines in rectangular mode, like you can in TextMate?
(Would be great if it was. TextMate is great for coding and plaintext, but not an option when working together with "normal" users, who uses Word and Pages.)
Rectangular selection and edit
Re: Rectangular selection and edit
The classic Nisus used to be able to do this. But NWP can't … (yet… I hope).
philip
- martin
- Official Nisus Person
- Posts: 5227
- Joined: 2002-07-11 17:14:10
- Location: San Diego, CA
- Contact:
Re: Rectangular selection and edit
I believe it's intentional, though also has some historical/technical reasons behind it (notably that there can be only one "insertion point"). Likely this will stay as it is, and one will not be able to type over a multipart selection. However, I do notice that one cannot paste over a multipart selection, which is unfortunate and is something that is not intentional. You should be able to paste over a multipart selection; I'll file that as an issue.flips wrote:Is this intentional? Is there a way to edit multiple lines in rectangular mode, like you can in TextMate?
That said, here's a macro that will ask you what to replace all selections with:
Code: Select all
# get selections to modify
$doc = Document.active
If ! $doc
Exit
End
$selections = $doc.textSelections
# ask user what to replace with
$count = $selections.count
$replacement = Prompt Input "Replace all $count selections with what text?", '', 'Replace'
# make replacements, go backwards so offsets don't shift
ForEach $selection in reversed $selections
$selection.text.replaceInRange($selection.range, $replacement)
End