Skip to content

Unbalanced parens make SidewaysArgumentTextobjI/A jump to unrelated line #24

Open
@idbrii

Description

@idbrii

Several times I've had sideways select text that doesn't include my cursor position. I think it would make more sense to do nothing than jump to another part of the buffer. I've found a reliable and small repro case:

EditorGUI.BeginProperty(position, label, property);
{
    SerializedProperty joint = property.serializedObject.FindProperty("Bone"); // will jump to here

    Debug.Log(string.Format("1) Found a good one: {0}"), joint); // selecting from here
}
EditorGUI.EndProperty();

Do:

/joint)
vi,

(i, is SidewaysArgumentTextobjI)

Result:

The SerializedProperty line is selected.

va, selects the S in SerializedProperty and the space before it.

The only case I can think of where sideways selects something that doesn't include my cursor position is on a comma and the next argument is on the following line (but I'd argue it should select the preceeding argument). Would it make sense to limit the textobjs to require inclusion of the cursor position?

Using 2d5cd2b on Gvim 8.0.596 Win64

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions