GNU nano - Bugs: bug #51408, indenting via M-} can add a wrong...
You are not allowed to post comments on this tracker with your current authentication level.
bug #51408: indenting via M-} can add a wrong number of spaces with --tabstospaces
Submitter: | David Lawrence Ramsey <dolorous> | ||
Submitted: | Fri 07 Jul 2017 05:42:55 AM UTC | ||
Severity: | 3 - Normal | Status: | Wont Fix |
Assigned to: | bens | Open/Closed: | Closed |
Jump to the original submission
Fri 08 Dec 2017 08:20:00 PM UTC, comment #11: |
Benno Schulenberg <bens> |
Sat 22 Jul 2017 08:00:28 PM UTC, comment #10: The opposite bug has been filed as buf #51438. |
Benno Schulenberg <bens> |
Tue 11 Jul 2017 07:23:55 AM UTC, comment #9: So, we've agreed that the bug is the opposite one: "*without* --tabstospaces, indenting via M-} adds a non-fixed amount of whitespace". |
Benno Schulenberg <bens> |
Fri 07 Jul 2017 07:37:33 PM UTC, comment #8: Okay; I figured as much.
|
David Lawrence Ramsey <dolorous> |
Fri 07 Jul 2017 06:05:01 PM UTC, comment #7: For unindenting, the type of whitespace should not matter, as long as all selected lines can be unindented by a full tab's worth. (If not all lines can be unindented, M-{ should do nothing.)
|
Benno Schulenberg <bens> |
Fri 07 Jul 2017 04:53:31 PM UTC, comment #6: After some thought, I'm in favor of the beginning for both indent and unindent. However, I thought I'd fix the existing behavior before changing it, which is why I made this patch first.
|
David Lawrence Ramsey <dolorous> |
Fri 07 Jul 2017 04:28:02 PM UTC, comment #5: The question is: should indenting add a tabsize worth of whitespace at the end of the line's leading whitespace, or at the beginning? The current method is weird, because it will add a tab after spaces (when tabstopaces is not set), which a) is bad form, and b) it doesn't preserve the relative indentation if some lines are indented by four spaces and others by a tab, for example.
|
Benno Schulenberg <bens> |
Fri 07 Jul 2017 02:11:54 PM UTC, comment #4: Updated version attached. And I'll definitely look at that other bug. |
David Lawrence Ramsey <dolorous> |
Fri 07 Jul 2017 11:03:22 AM UTC, comment #3: By the way, maybe have a look at bug #47684 too, and maybe comment there how /you/ think that indenting/unindenting should work when there are partial indents. |
Benno Schulenberg <bens> |
Fri 07 Jul 2017 10:26:28 AM UTC, comment #2: Patch doesn't apply. You changed some braces in the meantime. Please provide an updated patch against master. |
Benno Schulenberg <bens> |
Fri 07 Jul 2017 06:07:42 AM UTC, comment #1: Forget the last patch; the calculation was off since it relied on the current x position. The attached new patch properly calculates the number of spaces to indent per line when multiple lines are selected. |
David Lawrence Ramsey <dolorous> |
Fri 07 Jul 2017 05:42:55 AM UTC, original submission:
Indenting via Meta-} is supposed to add a tab or the equivalent to the indentation already on a line. However, when the --tabstospaces option is used, Meta-} always adds tabsize's worth of spaces to that place, instead of adding the number of spaces that pressing Tab would add. This can be reproduced as follows:
|
David Lawrence Ramsey <dolorous> |
Depends on the following items: None found
Items that depend on this one: None found
There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.
Follow 9 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2017-07-22 | bens | Open/Closed | Open | Closed | |
2017-07-11 | bens | Assigned to | dolorous | bens | |
2017-07-11 | bens | Status | Need Info | Wont Fix | |
2017-07-07 | bens | Status | In Progress | Need Info | |
2017-07-07 | dolorous | Attached File | - | Added 0001-text-add-the-right-amount-of-space-with-TABS_TO_SPAC.patch, #41148 | |
2017-07-07 | bens | Status | None | In Progress | |
Assigned to | None | dolorous | |||
2017-07-07 | dolorous | Attached File | - | Added 0001-text-add-the-right-amount-of-space-with-TABS_TO_SPAC.patch, #41145 | |
2017-07-07 | dolorous | Attached File | - | Added 0002-text-add-the-right-amount-of-space-with-TABS_TO_SPAC.patch, #41143 |
Powered by Savane 3.13-d3ae.
Corresponding source code
I meant "bug": bug #51438.