Repository navigation
Conversation
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #691 +/- ##
==========================================
- Coverage 94.17% 94.14% -0.04%
==========================================
Files 14 14
Lines 5768 5770 +2
Branches 470 470
==========================================
Hits 5432 5432
- Misses 335 337 +2
Partials 1 1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| if command.addr2.is_none() || context.last_address || reader.last_line()? { | ||
| // `first~step` selects single lines, so each one gets the text. | ||
| if command.addr2.is_none() | ||
| || matches!(command.addr2, Some(Address::StepMatch(_))) |
There was a problem hiding this comment.
could first~step be compiled into its own single address instead (e.g. Address::Step(first, step) in addr1, no addr2)?
then neither this special case nor the one in applies would be needed
163abac to
dfa6933
Compare
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
Merging this PR will not alter performance1 warning
Comparing |
dfa6933 to
8d885f5
Compare
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
first~step depends on the line number alone, so compile it to the single StepStart address that uutils#619 introduced for range starts, instead of addr1 Line plus addr2 StepMatch. It no longer starts late when line first never reaches the command (deleted, or joined by N), and c prints its text on every selected line. StepMatch stays for a regex first address.
8d885f5 to
0ea2552
Compare
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
first~stepwas compiled toaddr1 = firstplusaddr2 = StepMatch(step), a range, so it only started once linefirstreached the command. If line 1 is deleted or joined byN,1~2selected lines 2, 4, ... instead of 3, 5, ..., andcprinted its text only at the end of that "range".Rebased on main: #619 added
StepStart(first, step), matched on the line number alone, forfirst~step,addr2. This compiles a plainfirst~stepto that same single address too (as suggested in review), so the special cases are gone.StepMatchstays only for a regex first address.Tests:
test_step_address_counts_from_its_first_line(1d;1~2…,/b/d;1~2…,N;1~2…,0~2,3~0) andtest_step_address_change_prints_text_for_each_line; both fail on main. The range tests from #619 still pass. Checked against GNU sed 4.9.AI disclosure: written with help from Claude Code.
🤖 Generated with Claude Code