Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
patch 8.1.1748: :args output is not aligned
Problem: :args output is not aligned. Solution: Output a line break after the last item in a row.
- Loading branch information
74da393
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately it still appears to not be good:
I am seeing this with
vim $(seq 1 80)
(and COLUMNS=79 - but with regard to later comments it might have been 78 instead actually):4 is not in order, 9 appears twice..
74da393
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is also an trailing newline with args being longer than the available width (e.g. with
:exe 'args '.repeat('X', &columns+1)
).This fixes it:
74da393
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just tried the first issue again (COLUMNS=79):
With
1 .. 81
however:But only rows 3 and 4 have 20 items, and looking at in gdb showed that
cur_row
was getting too big.This fixes that:
But it is not clear to me what the initial patch here was fixing, and if it is still fixed.
Having tests for those would be good therefore.
Result:
74da393
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The initial patch was suggested by me. I set out today to write a test for it. And I discovered that there was still a bug in it. I was going to get fresh sources from the repo - only to find out that you already discovered and fixed the outstanding problem.
The thing that was fixed by the initial patch is still fixed after your fix. It was a situation where the last 2 of the 3 fields in the last column of the table were empty (
idx >= item_count
). The point was that it was more than 1. (You can see it on vim_dev). The test you brought with your follow-up fix deals with 19 empty fields. Specifically all of the last column and some more. That's even more than my 2 empty fields. That covers my situation too. So there is no need to add a test for it anymore. If you still want to check it, it was going to be based (as noted on vim_dev) on this:Which still works:
74da393
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tom-m
Thanks for the followup.
I've wondered myself if the test could be more concise (given that it was just from what I've tested, not trimmed), but I am glad that it covers all cases now though at least.