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

Re-render text area of editable views when view size changes #55

Merged
merged 1 commit into from
Jun 28, 2024

Conversation

stefanhaller
Copy link
Collaborator

Needed for jesseduffield/lazygit#3694, and reviewed as part of it.

Whenever the size of an editable view changes, try to scroll it to (0,0), and
then make the cursor visible again if needed. This is maybe not the ideal
behavior when the rendered content exceeds the size of the view, but it's good
enough, and simple.

This is relevant in two cases: when the terminal size changes while an editable
view is showing, and the first time we resize a view to its actual size in
layout() after showing it for the first time. For the second case we currently
have code that resizes the panel to its real size before showing the view, so
that the text area is scrolled correctly; we can get rid of that code now (which
is the main purpose of this commit).
@stefanhaller stefanhaller merged commit aed9e13 into master Jun 28, 2024
1 check passed
@stefanhaller stefanhaller deleted the rerender-text-area-when-size-changes branch June 28, 2024 06:12
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.

1 participant