Sublime Forum

Cut multiple lines after search

#1

Im trying to do a search on code thats writing different bits to the same register (something like the following)

register_a.1 = 1
register_b.3 = 0
register_c.2 = 0
register_d.4 = 1

register_a.2 = 1
register_b.2 = 0
register_c.1 = 0
register_d.4 = 1

register_a.3 = 1
register_b.3 = 0
register_c.2 = 0
register_d.3 = 1

i click on the first reference to register_a and hit ^d multiple times to mark each instance. Now i need to cut the entire line not just the marked “register_a” instances. I have multiple cursors but if i move any of them im left with only one. I tried moving the cursor to the start of the line and hitting shift cursor down to mark each line but the “home” operation kills all but the first cursor.

how can i do this?

this might actually be a bug because if i mark only a few of these items so that all the marks are on screen i CAN move all the cursors but if i mark enough that any of the cursors are off display any time i move them all but the first disappear.

p.s. just for some context the ACTUAL code i am working on is GPIO configuration for a Texus Instruments DSP and the code comes directly from TI. There are 36 GPIO pins and for the first 32 pins each one is configured by writing ONE BIT into the same set of registers over and over and over and over and over. What I want to see is a single write of ONE 32 bit value to registers 1, 2, 3, 4 and 5 etc etc and turn the absolute NIGHTMARE configuration file into something readable.

0 Likes

#2

If you’re losing selections by pressing home, it sounds like you might have some plugin that’s breaking your selections.

Also try out cmd+l, which selects the whole line that each cursor is on.

Also also, Sublime Text’s built-in copy/paste behaviour is arguably broken. If you’re displeased with the results of your copy/paste operation, check out github.com/adzenith/CopyEdit.

0 Likes

#3

Except that i dont have any plugins installed :smile:

assuming ctrl is the same as cmd pressing “cmd+i” does not seemto do anything but bring up a search prompt :confused:

0 Likes

#4

Try L, not I :smile:

By default, the home key moves each selection to the beginning of the line it’s on, so something has changed.

0 Likes

#5

aha ^L worked,

but… i should STILL be able to control the movement of every cursor using the cursor keys so im still calling bug on this :smile:
ty :smile:

0 Likes

#6

Try reverting your install if the normal cursor keys aren’t working for you.
sublimetext.com/docs/3/revert.html

0 Likes