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: remove global variable $maxline #224

Merged
merged 1 commit into from
Aug 27, 2023
Merged

Conversation

mknos
Copy link
Contributor

@mknos mknos commented Aug 27, 2023

  • I noticed that the recently added edJoin() didn't calculate a new $maxline...oops
  • Then I realised $maxline is a function of @lines
  • Add maxline(), returning an index based on @lines; now we can retire $maxline
  • The code is simpler when we don't need to calculate new $maxline values
  • When reading data in, use scalar(@tmplines) instead of incrementing $tmp_maxline
  • In edEdit(), $chars should count the newline appended to the last line of buffer (if newline was missing)
  • When testing I typed .= a lot to verify the current line was updated correctly

* I noticed that the recently added edJoin() didn't calculate a new $maxline...oops
* Then I realised $maxline is a function of @lines 
* Add maxline(), returning an index based on @lines; now we can retire $maxline
* We don't need to calculate new $maxline values
* When reading data in, use scalar(@tmplines) instead of incrementing $tmp_maxline
* In edEdit(), $chars should count the newline appended to the last line of buffer (if newline was missing)
* When testing I typed .= a lot to verify the current line was updated correctly
@briandfoy briandfoy self-assigned this Aug 27, 2023
@briandfoy briandfoy added Type: enhancement improve a feature that already exists Priority: low get to this whenever Program: ed The ed program labels Aug 27, 2023
@briandfoy briandfoy merged commit d5e8c3f into briandfoy:master Aug 27, 2023
1 check passed
@briandfoy briandfoy added Status: accepted The fix is accepted Status: released there is a new release with this fix and removed Priority: low get to this whenever Status: accepted The fix is accepted labels Aug 27, 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.

None yet

2 participants