Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing whole-line selection should keep original indentation #8124

Closed
clo4 opened this issue Aug 31, 2023 · 2 comments
Closed

Changing whole-line selection should keep original indentation #8124

clo4 opened this issue Aug 31, 2023 · 2 comments
Labels
A-indent Area: Indentation A-language-support Area: Support for programming/text languages C-bug Category: This is a bug

Comments

@clo4
Copy link
Contributor

clo4 commented Aug 31, 2023

#7316 being merged is a great improvement, I think it was definitely the right choice! It's way more ergonomic most of the time.

There's one thing that consistently bothers me with it though, which is that it indents to the line below the one that you're editing. I'm frequently changing things at the bottom of a block of indentation, which means I need to indent every time I type xc.

An example of this behavior (| is the cursor)

begin
    This is line 1
    This is line 2|
end

Then after xc

begin
    This is line 1
|
end

What I think the correct behavior should be:

begin
    This is line 1
    |
end

The solution (I think) is to use the line's original leading whitespace instead of doing what xcO would have done before.

@clo4 clo4 added the C-enhancement Category: Improvements label Aug 31, 2023
@clo4 clo4 changed the title Changing whole-line selection indents to line below Changing whole-line selection should keep original indentation Aug 31, 2023
@pascalkuthe
Copy link
Member

pascalkuthe commented Sep 1, 2023

this is a bug in the indent-queries of whatever language indent queries that is

@pascalkuthe pascalkuthe added C-bug Category: This is a bug A-language-support Area: Support for programming/text languages A-indent Area: Indentation and removed C-enhancement Category: Improvements labels Sep 1, 2023
@clo4
Copy link
Contributor Author

clo4 commented Sep 4, 2023

Interesting. I'll have a look at fixing the queries then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-indent Area: Indentation A-language-support Area: Support for programming/text languages C-bug Category: This is a bug
Projects
None yet
Development

No branches or pull requests

2 participants