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

Avoid blank line at end of view #4152

Merged
merged 1 commit into from
Jan 7, 2025

Conversation

stefanhaller
Copy link
Collaborator

  • PR Description

This updates gocui to include jesseduffield/gocui#68 and jesseduffield/gocui#69, which changes views to not have an extra blank line at the end when content ending in a newline character is written to them. This makes text views more consistent with list views, which don't have a blank line after the last list entry either.

@stefanhaller stefanhaller added the bug Something isn't working label Jan 5, 2025
Copy link
Owner

@jesseduffield jesseduffield left a comment

Choose a reason for hiding this comment

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

LGTM. Feel free to merge after bumping gocui

@stefanhaller stefanhaller force-pushed the avoid-blank-line-at-end-of-view branch from 716c2c5 to fe816c7 Compare January 6, 2025 08:28
@stefanhaller
Copy link
Collaborator Author

I had to add a commit to adapt some tests, and to change the behavior of the WrapViewLinesToWidth function accordingly; I forgot this the first time around. Since this affects the logic of the staging view, I'm going to run with this version for a bit more locally before merging to see if anything got broken by the change.

Copy link

codacy-production bot commented Jan 6, 2025

Coverage summary from Codacy

See diff coverage on Codacy

Coverage variation Diff coverage
Report missing for 13829d81 100.00%
Coverage variation details
Coverable lines Covered lines Coverage
Common ancestor commit (13829d8) Report Missing Report Missing Report Missing
Head commit (ae53059) 51622 44616 86.43%

Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: <coverage of head commit> - <coverage of common ancestor commit>

Diff coverage details
Coverable lines Covered lines Diff coverage
Pull request (#4152) 6 6 100.00%

Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: <covered lines added or modified>/<coverable lines added or modified> * 100%

See your quality gate settings    Change summary preferences

Codacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more

Footnotes

  1. Codacy didn't receive coverage data for the commit, or there was an error processing the received data. Check your integration for errors and validate that your coverage setup is correct.

This updates gocui to include jesseduffield/gocui#68 and
jesseduffield/gocui#69, which changes views to not have
an extra blank line at the end when content ending in a newline character is
written to them. This makes text views more consistent with list views, which
don't have a blank line after the last list entry either.
@stefanhaller stefanhaller force-pushed the avoid-blank-line-at-end-of-view branch from fe816c7 to ae53059 Compare January 7, 2025 16:34
@stefanhaller
Copy link
Collaborator Author

I tested this a bit more and didn't find any problems, so I'm going to merge.

@stefanhaller stefanhaller merged commit 80c212f into master Jan 7, 2025
15 checks passed
@stefanhaller stefanhaller deleted the avoid-blank-line-at-end-of-view branch January 7, 2025 16:37
stefanhaller added a commit that referenced this pull request Jan 20, 2025
- **PR Description**

This fixes a bug where adding enough new lines to a commit message
description such that it becomes taller than the window so that the
window needs to resize vertically, the cursor wouldn't move to the added
blank line, but stay at the end of the previous line. This was a
regression introduced with #4152.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants