GNU nano - Bugs: bug #50054, nano puts the file buffer in a bad...
You are not allowed to post comments on this tracker with your current authentication level.
bug #50054: nano puts the file buffer in a bad state when first loading a file
Submitter: | David Lawrence Ramsey <dolorous> | ||
Submitted: | Sat 14 Jan 2017 11:01:03 PM UTC | ||
Severity: | 3 - Normal | Status: | Wont Fix |
Assigned to: | bens | Open/Closed: | Closed |
Fri 24 Feb 2017 11:49:01 AM UTC, comment #5: |
Benno Schulenberg <bens> |
Mon 16 Jan 2017 08:13:32 PM UTC, comment #4: The bad state is that edittop is filebot while current is edittop, and reset_cursor() mishandles that the first time it's called, since its job is not to put edittop in range of current like edit_redraw() or edit_refresh() (both of which should be using the same code to check for current's being offscreen in softwrap mode, but that's a different problem). When you said you couldn't see how current_y could be less than zero in reset_cursor(), this is how it could be.
|
David Lawrence Ramsey <dolorous> |
Mon 16 Jan 2017 07:32:35 PM UTC, comment #3: Ad 4) The buffer not in a valid state? That edittop equals filebot is strange, but not invalid: one could reach it in any file by pressing M-\ and then holding down M-+.
|
Benno Schulenberg <bens> |
Sun 15 Jan 2017 12:22:51 AM UTC, comment #2: Attached version 2 of the patch. edittop is also erroneously left set to filebot in do_insertfile(), if you've loaded a file into a new buffer when using multibuffer mode. The patch fixes this instance as well. |
David Lawrence Ramsey <dolorous> |
Sat 14 Jan 2017 11:06:32 PM UTC, comment #1: The problem seems to originate in open_buffer(). When loading a file into a new buffer, it sets current to fileage and current_x to 0 in order to put them at the top of the file, but leaves edittop unchanged (which means it's set to filebot). The attached patch fixes this by setting edittop to fileage, as is done with current. |
David Lawrence Ramsey <dolorous> |
Sat 14 Jan 2017 11:01:03 PM UTC, original submission:
(Taken from patch #9215.)
|
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 6 latest changes.
Date | Changed by | Updated Field | Previous Value | => | Replaced by |
---|---|---|---|---|---|
2017-02-24 | bens | Status | None | Wont Fix | |
Assigned to | None | bens | |||
Open/Closed | Open | Closed | |||
2017-01-15 | dolorous | Attached File | - | Added 0001-tweaks-version-2-fix-file-buffer-s-being-in-a-bad-st.patch, #39480 | |
2017-01-14 | dolorous | Attached File | - | Added 0001-tweaks-fix-file-buffer-s-being-in-a-bad-state-when-l.patch, #39479 | |
2017-01-14 | dolorous | Attached File | - | Added reset_cursor-current_y-test.txt, #39478 |
Powered by Savane 3.13-758e.
Corresponding source code
Since there is no actual observable bad behavior, I'm not changing anything. (Rather I would remove more settings of edittop from the file reading code -- edittop is a display responsiblity, it should be unrelated to buffer handling.)