Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ed: simplify code for r command #354

Merged
merged 2 commits into from
Nov 30, 2023
Merged

ed: simplify code for r command #354

merged 2 commits into from
Nov 30, 2023

Conversation

mknos
Copy link
Contributor

@mknos mknos commented Nov 30, 2023

  • For "0r filename", file content is added to the beginning of lines list (preserving initial undef element)
  • For "3r filename", file content is added after the 3rd line in buffer (i.e. after element 4 considering initial undef element)
  • Each case can be written as a single call to splice (offset is 0+1 for "0r" case and 3+1 for "3r" case)

* For "0r filename", file content is added to the beginning of lines list (preserving initial undef element)
* For "3r filename", file content is added after the 3rd line in buffer (i.e. after element 4 considering initial undef element)
* Each case can be written as a single call to splice
@github-actions github-actions bot added Type: enhancement improve a feature that already exists Priority: low get to this whenever Program: ed The ed program labels Nov 30, 2023
Copy link
Owner

@briandfoy briandfoy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So much can be saved if people where comfortable with slice()

@briandfoy briandfoy merged commit ca92c4c into briandfoy:master Nov 30, 2023
2 checks passed
@briandfoy briandfoy self-assigned this Nov 30, 2023
@briandfoy briandfoy added Status: accepted The fix is accepted and removed Priority: low get to this whenever labels Nov 30, 2023
@briandfoy briandfoy added Status: released there is a new release with this fix and removed Status: accepted The fix is accepted labels Dec 22, 2023
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.

2 participants