Skip to content

Conversation

mknos
Copy link
Contributor

@mknos mknos commented Nov 22, 2024

  • Argument parsing within edMove() was a bit broken
  • edMove() implements the "t" and "m" commands
  • I noticed that bogus values for $args[0] were being accepted, e.g. n > maxline()
  • The argument is supposed to be any valid address, not just an address specified as a number
  • getAddr() already contains the functionality we want, so call it

Tests:
1,2m/main/ ---> append selected lines after regex match
1,2m/mainxxxxxx/ ---> nomatch error
1,2m// ---> use saved pattern for search (fails if no pattern was saved yet)
1,2m. ---> append lines after current address (explicit)
1,2m ---> append lines after current address (default)
1,2m$ ---> append lines after last line
1,2m'x ---> append lines after marked line x (fails if nothing was marked for x yet)
24,25m0 --> move selected lines to start of editor buffer

* Argument parsing within edMove() was a bit broken
* Function edMove() implements the "t" and "m" commands
* I noticed that bogus values for $args[0] were being accepted, e.g. n > maxline()
* The argument is supposed to be any valid address, not just an address specified as a number
* Call into getAddr() to get the functionality we want

Tests:
1,2m/main/ ---> append selected lines after regex match
1,2m/mainxxxxxx/ ---> no match error
1,2m// ---> use saved pattern for search (fails if no pattern was saved yet)
1,2m. ---> append lines after current address (explicit)
1,2m ---> append lines after current address (default)
1,2m$ ---> append lines after last line
1,2m'x ---> append lines after marked line x (fails if nothing was marked for x yet)
24,25m0 --> move selected lines to start of editor buffer
@mknos mknos temporarily deployed to automated_testing November 22, 2024 00:35 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing November 22, 2024 00:35 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing November 22, 2024 00:35 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing November 22, 2024 00:35 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing November 22, 2024 00:35 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing November 22, 2024 00:35 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing November 22, 2024 00:35 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing November 22, 2024 00:35 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing November 22, 2024 00:35 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing November 22, 2024 00:35 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing November 22, 2024 00:35 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing November 22, 2024 00:35 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing November 22, 2024 00:35 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing November 22, 2024 00:35 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing November 22, 2024 00:35 — with GitHub Actions Inactive
@github-actions github-actions bot added the Type: enhancement improve a feature that already exists label Nov 22, 2024
@mknos mknos temporarily deployed to automated_testing November 22, 2024 00:35 — with GitHub Actions Inactive
@github-actions github-actions bot added Priority: low get to this whenever Program: ed The ed program labels Nov 22, 2024
@mknos mknos temporarily deployed to automated_testing November 22, 2024 00:35 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing November 22, 2024 00:35 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing November 22, 2024 00:35 — with GitHub Actions Inactive
@mknos mknos temporarily deployed to automated_testing November 22, 2024 00:36 — with GitHub Actions Inactive
@coveralls
Copy link

coveralls commented Nov 22, 2024

Pull Request Test Coverage Report for Build 11964167431

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.7%) to 73.069%

Totals Coverage Status
Change from base Build 11954585841: -0.7%
Covered Lines: 350
Relevant Lines: 479

💛 - Coveralls

@briandfoy briandfoy merged commit 01f2e73 into briandfoy:master Nov 22, 2024
22 of 23 checks passed
@briandfoy
Copy link
Owner

changes: m command accepts address argument

@briandfoy briandfoy self-assigned this Nov 22, 2024
@briandfoy briandfoy added Status: accepted The fix is accepted and removed Priority: low get to this whenever labels Nov 22, 2024
@briandfoy briandfoy added Status: released there is a new release with this fix and removed Status: accepted The fix is accepted labels Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Program: ed The ed program Status: released there is a new release with this fix Type: enhancement improve a feature that already exists
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants