-
Notifications
You must be signed in to change notification settings - Fork 32
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 #69
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Intuitively I feel that this is an unnecessary change and that it's good to know that there's a newline at the end of the file, but given I've got lazygit configured to allow scrolling past the end, I have no experience with this problem in the first place, so I'm happy to defer to your judgement.
We are going to reuse this in the next commit.
c095b97
to
3fa31d2
Compare
I see this as similar to viewing a file in less. If you view a file that's longer than the height of the screen, and scroll all the way to the bottom, it doesn't show a blank line for the last line feed either. It does for any additional line feeds at the end though (if you have more than one |
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.
Makes sense |
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.
- **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.
If
writeString
orwriteRunes
is called with text ending in a newline character (which is very common), we currently insert an extra blank line at the bottom of the view, which doesn't look right. Avoid adding this extra line unless more text is added with anotherwriteString
call.Sits on top of #68.