GNU nano - Bugs: bug #47684, unindenting destroys relative...
You are not allowed to post comments on this tracker with your current authentication level.
bug #47684: unindenting destroys relative indentation
Submitter: | Benno Schulenberg <bens> | ||
Submitted: | Wed 13 Apr 2016 08:27:33 AM UTC | ||
Severity: | 3 - Normal | Status: | Fixed |
Assigned to: | dolorous | Open/Closed: | Closed |
Jump to the original submission
Sun 10 Dec 2017 07:30:41 PM UTC, comment #6: |
Benno Schulenberg <bens> |
Wed 16 Aug 2017 05:08:32 PM UTC, comment #5: Fixed in git, 0f4716e1. Thanks for the overhaul. |
Benno Schulenberg <bens> |
Tue 11 Jul 2017 09:12:55 AM UTC, comment #4: See http://lists.gnu.org/archive/html/nano-devel/2017-07/msg00003.html for the first iteration of David's patch set.
|
Benno Schulenberg <bens> |
Sun 09 Jul 2017 02:12:17 AM UTC, comment #3: Actually, never mind that patch set. Locally, I've adjusted it some more, and after some study of how commenting does it, I've been able to experimentally hook indent/unindent up to the undo/redo code (still testing that), and it seems like something that should go to the mailing list instead of here. |
David Lawrence Ramsey <dolorous> |
Fri 07 Jul 2017 11:49:25 PM UTC, comment #2: Sounds good to me.
|
David Lawrence Ramsey <dolorous> |
Sat 23 Apr 2016 09:50:00 AM UTC, comment #1: Thinking this through again, I now think that nano should 1) leave partial indents alone (any series of leading spaces that is less than the tab width and is not followed by a tab), 2) when adding an indentation step, it should add the tab at the start of the line, not where the non-whitespace characters start, 3) when multiple lines are selected, it should only unindent if they can all be unindented, it should not change the relative indentation of the lines among themselves.
|
Benno Schulenberg <bens> |
Wed 13 Apr 2016 08:27:33 AM UTC, original submission:
When a line starts with only spaces (less than eight), M-{ (unindent) does not recognize this as an indentation and does not remove them. But when you first type M-} and then M-{, the spaces are removed together with the tab that was added after them by M-}.
|
Benno Schulenberg <bens> |
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 6 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2017-08-28 | bens | Open/Closed | Open | Closed | |
2017-08-16 | bens | Status | In Progress | Fixed | |
2017-07-11 | bens | Status | None | In Progress | |
Assigned to | None | dolorous | |||
Summary | unindent is not working properly | unindenting destroys relative indentation | |||
2017-07-07 | dolorous | Attached File | - | Added indent-overhaul.zip, #41151 |
Powered by Savane 3.13-758e.
Corresponding source code
Commit eb937f81 put things in the state that the original report envisioned: 1) when a line starts with a partial indent, an unindent removes it; and 2) when a line starts with a full indent followed by a partial indent, an unindent just removes the full indent and leaves the partial indent alone. This retains relative indentations as long as all selected lines begin with at least one full indent, but allows to quickly equalize the indentations of selected lines when the user wants to. My later idea, to limit the permissions of the unindent command, just gets in the way of the user.