Strafe rectangular selection

Discussion Forums discussion Strafe rectangular selection

This topic contains 0 voices and has 4 replies.

Viewing 5 posts - 1 through 5 (of 5 total)
Author Posts
Author Posts
June 27, 2011 at 8:59 pm #5347

Nux
Member

Hi. I’ve been playing a lot with rectangular selection lately (best programming discovery of a year for me ;-)). There is one this I miss though – strafing selection (moving to the right/left). For me this is especially useful when I have a long cursor (0-lenght selection through few lines) and want to edit few lines at once in two or more places.

So I’ve made this script:

http://pastebin.com/gCyhCmr9

But I’m wondering if this is bundled in PN2? Also I’m looking for a feedback of what do you think should happen when you reach right/left edge? Should it behave differently in normal and rectangular selection mode?

June 29, 2011 at 1:33 pm #17925

simon
Key Master

Nice script, thanks for sharing. I, too, have wanted to do this so it seems like a good candidate for inclusion in the core. I added an enhancement request for this:

http://code.google.com/p/pnotepad/issues/detail?id=1366

Also you might want to add to scriptshare:

http://scriptshare.rocketmonkeys.com/

June 30, 2011 at 5:53 pm #17926

CoDEmanX
Member

Great script! Also works in combination with Shift!!

If it reaches the border, it should stop there in my opinion. It currently moves to the previous line (or even out of the text bounds), which might be helpful for certain people. I’d prefer the cursor to stay inside of the original line though.

June 30, 2011 at 7:11 pm #17927

Nux
Member

Script added here (as part of my aligning functions):

http://scriptshare.rocketmonkeys.com/script/34

Had some problems with script share before, I’m glad password reset works now :-). Also updated other scripts if anyone is interested. Selections is (or I hope it is) particularly useful for learing how to manipulate selections in PN.

July 1, 2011 at 6:18 am #17928

Nux
Member

I think I’ll make 3 strafing modes for 3 selection modes:

  1. In singular selection just keep it like it is (move like a snake).
  2. In rectangular selection move selection beyond text and keep it rectangular (not yet sure if this will work smoothly).
  3. In multi selection – stop at EOLs (and start of lines).

Would that work for you?

PS: Shift is for running, Alt is for strafing ;-).

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.