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

Fix auto-scrolling on long lines #302

Merged
merged 1 commit into from
Feb 10, 2025
Merged

Conversation

dbeecham
Copy link
Contributor

@dbeecham dbeecham commented Feb 6, 2025

If the cursor is on the last line, the output of the terminal window is always auto-scrolled to the last line, so I removed the line-counting logic and jumped to the last line when the buffer is created.

I also added a some various smaller improvements;

  1. nvim_open_term automatically converts \n to \r\n, so the regex loop is not needed
  2. Rewrote the "header" logic slightly for readability and allows header strings longer than 6 characters
  3. Sent the terminal message separately, as it's theoretically allowed to contain nulls, which string operations does not

Thank you.

Copy link
Owner

@michaelb michaelb left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for contributing.

I will release a new version after merging this and a couple commits from the development branch EDIT: I'm realizing I may not need to release a new version as only the Lua part of the code is changed, and releases are useful to distribute changes of the Rust (compiled) part. I usually can't skip issuing a new release, but for the current changes it's perfectly appropriate

michaelb added a commit that referenced this pull request Feb 10, 2025
@michaelb michaelb merged commit dfed7aa into michaelb:master Feb 10, 2025
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants