Skip to content

FR: include_surrounding_whitespace should adjust whitespace characters included based on mode #850

@chrisgrieser

Description

@chrisgrieser

Is your feature request related to a problem? Please describe.
Enabling include_surrounding_whitespace often leads to technically correct, but somewhat unexpected behavior.

Given this text:

local obj = {
	text = "foobar", -- comment
	number = 123,
}

For instance, deleting the --comment via @comment.outer results in:

local obj = {
	text = "foobar", number = 123,
}

Which is technically correct – surrounding whitespace was included – but very unintuitive behavior.

Describe the solution you'd like
include_surrounding_whitespace should not include line breaks if the text object is characterwise.

Describe alternatives you've considered
Simply disabling include_surrounding_whitespace entirely (which is a waste, since it's in principle a nice feature)

Additional context
There are a few other issues like #575 which seem to be related to this problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions