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 panic #100

Merged
merged 2 commits into from
Sep 29, 2020
Merged

fix panic #100

merged 2 commits into from
Sep 29, 2020

Conversation

aaronjanse
Copy link
Owner

When exiting vim!

v.Screen = append(v.Screen, []ecma48.StyledChar{})
}
xDiff := v.Cursor.X - len(v.Screen[v.Cursor.Y]) + 1
if xDiff > 0 {
v.Screen = append(v.Screen, make([]ecma48.StyledChar, xDiff))
v.Screen[v.Cursor.Y] = append(v.Screen[v.Cursor.Y], make([]ecma48.StyledChar, xDiff)...)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do I feel like using append will cause bugs XD

Copy link
Owner Author

Choose a reason for hiding this comment

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

Yeah, append is scary. But it's supposed to be safe when appending something to itself unless slice stuff is going on

Copy link
Collaborator

@PotatoParser PotatoParser left a comment

Choose a reason for hiding this comment

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

Looks good, though there are some concerns that I have.

vterm/ops.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@PotatoParser PotatoParser left a comment

Choose a reason for hiding this comment

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

Looks good!

@aaronjanse aaronjanse merged commit f277482 into master Sep 29, 2020
@aaronjanse aaronjanse deleted the fixups branch March 8, 2021 22:28
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