Closed jwink75 closed 8 months ago
Why make this work only on the full document, instead of letting the user select a region?
Well, only because that’s what I wanted it to do when I wrote it :) I can definitely see the utility in that though so let me address it
(Of course the script can do whatever you want it to do. It's just that the current version works on the selected region, so this would be a breaking change.)
I submitted a version last night that works on the current selection, but if there is no selection puts up an AlertYesNo asking if you want to process the whole thing… I think this is the best if both worlds solution!
Your solution is fine. Just FYI, some scripts use a library function called get_selected_region_or_whole_doc()
(docs here) to do this transparently -- run the plugin over a selection if there is one, else over the whole doc.
That’s good to know, I will use that in the future. My first thought was to do that but then thought that maybe the prompt would be helpful? I could certainly take the alert window out too…
IMO, either way is fine. I think we have scripts that take both approaches.
Then I think let’s leave with the current iteration. I feel like when I know it’s going to process the whole document (like it used to) I don’t need/want a reminder, but now that the ability to be selective is there it’s often nice to get the reminder (especially with destructive edits!)
I feel like when I know it’s going to process the whole document (like it used to)
Just to be clear, the version of the script currently available in the repo works on the selected region. Processing the whole document is the new functionality.
Did it not update? Man, I hate Github. I'll try to figure out why in a moment - I swear I uploaded a fixed version last night.
Your pull request has the new functionality. What I'm saying is that on https://finalelua.com today, the script operates on the selected region. Your pull request is adding the "whole document" functionality.
Ah! Oh good! Yes, that is right, or at least partially right. This adds two things:
Thanks Aaron!
Personally I hate question dialogs. Hitting Undo is much less disruptive than a dialog. ymmv, but that's why I created the library function.
Fair enough… I’ll go ahead and remove the dialog. Nicer for the way I want to use it most of the time anyway :)
Added menu option to replace removed ties with slurs