textobj-word-column.vim icon indicating copy to clipboard operation
textobj-word-column.vim copied to clipboard

Incomplete selection at EOL?

Open jdanbrown opened this issue 12 years ago • 3 comments

On this text:

    id:                 String,
    node:               String,
    lastTried:          sql.Timestamp,
    lastTriedUri:       String,
    lastTriedSeeding:   sql.Timestamp,
    lastTriedDepth:     Int,
    lastFetched:        Option[sql.Timestamp],
    lastFetchedStatus:  Option[Int],
    lastParsed:         Option[sql.Timestamp],
    lastParsedOutLinks: Option[Int]

I do viC from here:

Screen Shot 2013-03-01 at 12 58 08 PM

and get this selection:

Screen Shot 2013-03-01 at 12 58 27 PM

whereas I was expecting a selection more like this:

Screen Shot 2013-03-01 at 12 59 58 PM

jdanbrown avatar Mar 01 '13 18:03 jdanbrown

Using cb40e14

jdanbrown avatar Mar 01 '13 18:03 jdanbrown

To have the behavior you are wanting, the plugin would have to detect that the initial word selection (based on vaW in your example) abutted the end of the line, and then it would automatically switch to the special $ style of blockwise selection.

I'm not sure if there would be any unintended side effects. I'll have to try it out and see.

In the mean time, vic$ will get you the selection you are seeking. (You probably already knew that, but just in case...)

coderifous avatar Mar 01 '13 22:03 coderifous

Hmm, yeah, it makes sense that you'd have to handle $ blocks specially. One complication would be something like this:

a b
x y z
0 1 2

—if I'm on b and do vip then I might expect it to only select the center column instead of doing the $ block selection. So you could go further and detect that only parts of the column abut EOL, and then not do the $ selection.

In any case, my vote is that the naive $ selection is less surprising than the current behavior, especially with dic or cic.

jdanbrown avatar Mar 01 '13 22:03 jdanbrown